SubSlopeComponent3D
Summary
Creates and draws subslopes in 3D.
Constructor
SubSlopeComponent3D
Syntax
SubSlopeComponent3D
-
core
Summary
Parameters:
-
core
wnp.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:
-
wallMesh
BABYLON.MeshMesh of the walls.
-
points
BABYLON.Vector3Points of the subslope plane mesh.
-
subslope
SubSlopeStructureThe current subslope.
-
structure
FloorStructureThe floor on which the subslope must be added.
-
sceneF
BABYLON.MeshCurrent floor mesh.
buildCSG
Syntax
buildCSG
-
points
-
structure
-
sceneF
Summary
Builds the CSG mesh which carves a part of the wall mesh.
Parameters:
-
points
BABYLON.Vector3Points of the subslope plane mesh.
-
structure
SubSlopeStructureStructure of the SubSlope
-
sceneF
BABYLON.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:
-
wallMesh
BABYLON.MeshMesh of the wall.
-
wallCSG
BABYLON.CSGMesh of the wall but in CSG.
-
roomCSG
BABYLON.CSGCSG of the room.
-
subslopeCSG
BABYLON.CSGCSG of all the subslopes.
-
sceneF
BABYLON.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:
-
structure
FloorStructureRelated floor structure.
-
sceneF
BABYLON.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:
-
context
StringThe 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:
-
event
EventThe 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:
-
deltaTime
NumberThe 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:
-
floor
BABYLON.Mesh3D Floor mesh.
-
structure
FloorStructureRelated floor structure.
-
walls
BABYLON.MeshThe resultant wall mesh for this floor (The subslopes carve the wall mesh when built).