-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhancement add new web nodes (#5328)
* joint, hingejoint, jointparamaters, hingejointsparameters,logicaldevice * rotational motor * linear motor, sliderjoint * hinge2 with no device distinction * balljoint * accelerometer * fieldtype solid device * create classes * connect solid device in parser * fieldmodel track and propeller * track * propeller * clean project * reorder * Update resources/web/wwi/Parser.js Co-authored-by: ad-daniel <[email protected]> * Update resources/web/wwi/Parser.js Co-authored-by: ad-daniel <[email protected]> * Update resources/web/wwi/Parser.js Co-authored-by: ad-daniel <[email protected]> * Update resources/web/wwi/Parser.js Co-authored-by: ad-daniel <[email protected]> * e * switch Co-authored-by: ad-daniel <[email protected]>
- Loading branch information
Showing
50 changed files
with
1,979 additions
and
148 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import WbSolid from './WbSolid.js'; | ||
|
||
// This class is used to retrieve the type of device | ||
export default class WbAccelerometer extends WbSolid { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import WbSolid from './WbSolid.js'; | ||
|
||
// This class is used to retrieve the type of device | ||
export default class WbAltimeter extends WbSolid { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import WbHinge2Joint from './WbHinge2Joint.js'; | ||
|
||
export default class WbBallJoint extends WbHinge2Joint { | ||
#device3; | ||
#jointParameters3; | ||
constructor(id) { | ||
super(id); | ||
this.#device3 = []; | ||
} | ||
|
||
get device3() { | ||
return this.#device3; | ||
} | ||
|
||
set device3(device) { | ||
this.#device3 = device; | ||
} | ||
|
||
get jointParameters3() { | ||
return this.#jointParameters3; | ||
} | ||
|
||
set jointParameters3(jointParameters) { | ||
this.#jointParameters3 = jointParameters; | ||
} | ||
|
||
preFinalize() { | ||
super.preFinalize(); | ||
this.#device3.forEach(child => child.preFinalize()); | ||
this.#jointParameters3?.preFinalize(); | ||
} | ||
|
||
postFinalize() { | ||
super.postFinalize(); | ||
|
||
this.#device3.forEach(child => child.postFinalize()); | ||
this.#jointParameters3?.postFinalize(); | ||
} | ||
|
||
delete() { | ||
let index = this.#device3.length - 1; | ||
while (index >= 0) { | ||
this.#device3[index].delete(); | ||
--index; | ||
} | ||
|
||
this.#jointParameters3?.delete(); | ||
|
||
super.delete(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import WbJointParameters from './WbJointParameters.js'; | ||
|
||
export default class WbBallJointParameters extends WbJointParameters { | ||
#anchor; | ||
constructor(id, position, axis, anchor, minStop, maxStop) { | ||
super(id, position, axis, minStop, maxStop); | ||
this.#anchor = anchor; | ||
} | ||
|
||
get anchor() { | ||
return this.#anchor; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import WbLogicalDevice from './WbLogicalDevice.js'; | ||
|
||
// This class is used to retrieve the type of device present in the joint | ||
export default class WbBrake extends WbLogicalDevice { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import WbSolid from './WbSolid.js'; | ||
|
||
// This class is used to retrieve the type of device | ||
export default class WbCamera extends WbSolid { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import WbSolid from './WbSolid.js'; | ||
|
||
// This class is used to retrieve the type of device | ||
export default class WbCharger extends WbSolid { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import WbSolid from './WbSolid.js'; | ||
|
||
// This class is used to retrieve the type of device | ||
export default class WbCompass extends WbSolid { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import WbSolid from './WbSolid.js'; | ||
|
||
// This class is used to retrieve the type of device | ||
export default class WbConnector extends WbSolid { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import WbSolid from './WbSolid.js'; | ||
|
||
// This class is used to retrieve the type of device | ||
export default class WbDisplay extends WbSolid { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import WbSolid from './WbSolid.js'; | ||
|
||
// This class is used to retrieve the type of device | ||
export default class WbDistanceSensor extends WbSolid { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import WbSolid from './WbSolid.js'; | ||
|
||
// This class is used to retrieve the type of device | ||
export default class WbEmitter extends WbSolid { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import WbSolid from './WbSolid.js'; | ||
|
||
// This class is used to retrieve the type of device | ||
export default class WbGps extends WbSolid { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import WbSolid from './WbSolid.js'; | ||
|
||
// This class is used to retrieve the type of device | ||
export default class WbGyro extends WbSolid { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import WbHingeJoint from './WbHingeJoint.js'; | ||
|
||
export default class WbHinge2Joint extends WbHingeJoint { | ||
#device2; | ||
#jointParameters2; | ||
constructor(id) { | ||
super(id); | ||
this.#device2 = []; | ||
} | ||
|
||
get device2() { | ||
return this.#device2; | ||
} | ||
|
||
set device2(device) { | ||
this.#device2 = device; | ||
} | ||
|
||
get jointParameters2() { | ||
return this.#jointParameters2; | ||
} | ||
|
||
set jointParameters2(jointParameters) { | ||
this.#jointParameters2 = jointParameters; | ||
} | ||
|
||
preFinalize() { | ||
super.preFinalize(); | ||
this.#device2.forEach(child => child.preFinalize()); | ||
this.#jointParameters2?.preFinalize(); | ||
} | ||
|
||
postFinalize() { | ||
super.postFinalize(); | ||
|
||
this.#device2.forEach(child => child.postFinalize()); | ||
this.#jointParameters2?.postFinalize(); | ||
} | ||
|
||
delete() { | ||
let index = this.#device2.length - 1; | ||
while (index >= 0) { | ||
this.#device2[index].delete(); | ||
--index; | ||
} | ||
|
||
this.#jointParameters2?.delete(); | ||
|
||
super.delete(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import WbJoint from './WbJoint.js'; | ||
|
||
export default class WbHingeJoint extends WbJoint { | ||
#device; | ||
constructor(id) { | ||
super(id); | ||
this.#device = []; | ||
} | ||
|
||
get device() { | ||
return this.#device; | ||
} | ||
|
||
set device(device) { | ||
this.#device = device; | ||
} | ||
|
||
preFinalize() { | ||
super.preFinalize(); | ||
this.#device.forEach(child => child.preFinalize()); | ||
} | ||
|
||
postFinalize() { | ||
super.postFinalize(); | ||
|
||
this.#device.forEach(child => child.postFinalize()); | ||
} | ||
|
||
delete() { | ||
let index = this.#device.length - 1; | ||
while (index >= 0) { | ||
this.#device[index].delete(); | ||
--index; | ||
} | ||
|
||
super.delete(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import WbJointParameters from './WbJointParameters.js'; | ||
|
||
export default class WbHingeJointParameters extends WbJointParameters { | ||
#anchor; | ||
constructor(id, position, axis, anchor, minStop, maxStop) { | ||
super(id, position, axis, minStop, maxStop); | ||
this.#anchor = anchor; | ||
} | ||
|
||
get anchor() { | ||
return this.#anchor; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import WbSolid from './WbSolid.js'; | ||
|
||
// This class is used to retrieve the type of device | ||
export default class WbInertialUnit extends WbSolid { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import WbBaseNode from './WbBaseNode.js'; | ||
import WbWorld from './WbWorld.js'; | ||
|
||
export default class WbJoint extends WbBaseNode { | ||
#endPoint; | ||
#jointParameters; | ||
|
||
get endPoint() { | ||
return this.#endPoint; | ||
} | ||
|
||
set endPoint(endPoint) { | ||
this.#endPoint = endPoint; | ||
} | ||
|
||
get jointParameters() { | ||
return this.#jointParameters; | ||
} | ||
|
||
set jointParameters(jointParameters) { | ||
this.#jointParameters = jointParameters; | ||
} | ||
|
||
updateBoundingObjectVisibility() { | ||
this.#endPoint?.updateBoundingObjectVisibility(); | ||
} | ||
|
||
createWrenObjects() { | ||
super.createWrenObjects(); | ||
|
||
this.#endPoint?.createWrenObjects(); | ||
} | ||
|
||
delete() { | ||
const parent = WbWorld.instance.nodes.get(this.parent); | ||
if (typeof parent !== 'undefined') { | ||
if (typeof parent.endPoint !== 'undefined') | ||
parent.endPoint = undefined; | ||
else { | ||
const index = parent.children.indexOf(this); | ||
parent.children.splice(index, 1); | ||
} | ||
} | ||
|
||
this.#jointParameters?.delete(); | ||
this.#endPoint?.delete(); | ||
|
||
super.delete(); | ||
} | ||
|
||
preFinalize() { | ||
super.preFinalize(); | ||
this.#jointParameters?.preFinalize(); | ||
this.#endPoint?.preFinalize(); | ||
} | ||
|
||
postFinalize() { | ||
super.postFinalize(); | ||
|
||
this.#jointParameters?.postFinalize(); | ||
this.#endPoint?.postFinalize(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import WbBaseNode from './WbBaseNode.js'; | ||
import WbWorld from './WbWorld.js'; | ||
|
||
export default class WbJointParameters extends WbBaseNode { | ||
#position; | ||
#axis; | ||
#minStop; | ||
#maxStop; | ||
constructor(id, position, axis, minStop, maxStop) { | ||
super(id); | ||
this.#position = position; | ||
this.#axis = axis; | ||
this.#minStop = minStop; | ||
this.#maxStop = maxStop; | ||
} | ||
|
||
get position() { | ||
return this.#position; | ||
} | ||
|
||
get axis() { | ||
return this.#axis; | ||
} | ||
|
||
get minStop() { | ||
return this.#minStop; | ||
} | ||
|
||
get maxStop() { | ||
return this.#maxStop; | ||
} | ||
|
||
delete() { | ||
const parent = WbWorld.instance.nodes.get(this.parent); | ||
if (typeof parent !== 'undefined') { | ||
if (typeof parent.jointParameters !== 'undefined') | ||
parent.jointParameters = undefined; | ||
} | ||
|
||
super.delete(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import WbSolid from './WbSolid.js'; | ||
|
||
// This class is used to retrieve the type of device | ||
export default class WbLed extends WbSolid { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import WbSolid from './WbSolid.js'; | ||
|
||
// This class is used to retrieve the type of device | ||
export default class WbLidar extends WbSolid { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import WbSolid from './WbSolid.js'; | ||
|
||
// This class is used to retrieve the type of device | ||
export default class WbLightSensor extends WbSolid { | ||
} |
Oops, something went wrong.