SubSlopeComponent3D
Summary
Creates and draws subslopes in 3D.
Constructor
SubSlopeComponent3D
Syntax
SubSlopeComponent3D
-
core
Summary
Parameters:
-
corewnp.CoreWanaplan core.
Item Index
Methods
Properties
Events
Methods
addSubSlope
Syntax
addSubSlope
-
wallMesh -
points -
subslope -
structure -
sceneF
Summary
Adds the subslope mesh to the scene.
Parameters:
-
wallMeshBABYLON.MeshMesh of the walls.
-
pointsBABYLON.Vector3Points of the subslope plane mesh.
-
subslopeSubSlopeStructureThe current subslope.
-
structureFloorStructureThe floor on which the subslope must be added.
-
sceneFBABYLON.MeshCurrent floor mesh.
buildCSG
Syntax
buildCSG
-
points -
structure -
sceneF
Summary
Builds the CSG mesh which carves a part of the wall mesh.
Parameters:
-
pointsBABYLON.Vector3Points of the subslope plane mesh.
-
structureSubSlopeStructureStructure of the SubSlope
-
sceneFBABYLON.MeshCurrent floor.
Returns:
Final CSG mesh.
buildFromCSG
Syntax
buildFromCSG
-
wallMesh -
wallCSG -
roomCSG -
subslopeCSG -
sceneF
Summary
Carves the wall with the big union of CSG.
Parameters:
-
wallMeshBABYLON.MeshMesh of the wall.
-
wallCSGBABYLON.CSGMesh of the wall but in CSG.
-
roomCSGBABYLON.CSGCSG of the room.
-
subslopeCSGBABYLON.CSGCSG of all the subslopes.
-
sceneFBABYLON.MeshCurrent floor mesh.
compute
Syntax
compute
()
private
Summary
Recompute of the component.destroy
Syntax
destroy
()
Summary
Destructor.disable
Syntax
disable
()
Summary
Disables the componentdrawSSForStructure
Syntax
drawSSForStructure
-
structure -
sceneF
Summary
Carves and creates all the subslopes without a roof for a floor.
Parameters:
-
structureFloorStructureRelated floor structure.
-
sceneFBABYLON.MeshFloor mesh.
enable
Syntax
enable
()
Summary
Enables the componentgetFloor
Syntax
getFloor
-
[structure]
Summary
Gets the 3D mesh of the floor structure in parameter (by default current floor).Parameters:
-
[structure]FloorStructure optionalThe floor structure.
Returns:
The floor mesh in 3D.
initialize
Syntax
initialize
()
Summary
Method called when Wanaplan is initialized. You don't need to call this method manually.onContextChanged
Syntax
onContextChanged
-
context
Summary
Method called when the context is switched (2D -> 3D or 3D -> 2D)Parameters:
-
contextStringThe new context
onWallsReady
Syntax
onWallsReady
-
event
Summary
Triggered on event wnp.engine3D.wallsReady.
Adds subslopes meshes (planes for subslopes without a roof) to the scene.
Parameters:
-
eventEventThe JS event.
startListening
Syntax
startListening
()
Summary
Calls all the event listeners.stopListening
Syntax
stopListening
()
Summary
Removes all the event listeners.update
Syntax
update
-
deltaTime
Summary
Updates the dynamic part of the component.Parameters:
-
deltaTimeNumberThe time interval.
Properties
keyboardManager
Syntax
keyboardManager
wnp.KeyboardManager
Summary
Instance of the Keyboard Manager (shortcut to wanaplan.keyboardManager).structure
Syntax
structure
wnp.Structure
Summary
Instance of the structure (shortcut to wanaplan.structure).Events
wnp.engine3D.subslopesReady
Syntax
wnp.engine3D.subslopesReady
Summary
Fired when the subslopes are ready and added to the scene.
Event Payload:
-
floorBABYLON.Mesh3D Floor mesh.
-
structureFloorStructureRelated floor structure.
-
wallsBABYLON.MeshThe resultant wall mesh for this floor (The subslopes carve the wall mesh when built).