RoofComponent3D
Summary
RoofComponent3D.
Constructor
RoofComponent3D
Syntax
RoofComponent3D
-
core
Summary
Parameters:
-
core
CoreThe main engine.
Item Index
Methods
Properties
Events
Methods
addRoof
Syntax
addRoof
-
wallMesh
-
roof
-
structure
-
sceneF
Summary
Adds the roof mesh to the scene.
Parameters:
-
wallMesh
BABYLON.MeshMesh of the walls.
-
roof
RoofStructureThe current roof.
-
structure
FloorStructureThe floor on which the roof must be added.
-
sceneF
BABYLON.MeshCurrent floor mesh.
checkThicknessVector
Syntax
checkThicknessVector
-
roof
-
point
-
structure
Summary
Returns vector to add to the point on the roof bottom plane so it becomes part of the top plane
Parameters:
-
roof
RoofStructureThe current roof
-
point
BABYLON.Vector3the point of the bottom plane to elevate
-
structure
FloorStructureThe floor on which the roof must be added.
Returns:
3D thickness vector
compute
Syntax
compute
()
private
Summary
Recompute of the component.destroy
Syntax
destroy
()
Summary
Destructor.disable
Syntax
disable
()
Summary
Disables the componentenable
Syntax
enable
()
Summary
Enables the componentextendRoof
Syntax
extendRoof
-
plane
-
roof
-
withGable
-
withOverhang
Summary
Extends subslope plane to include roof overhangs and meet with opposite roof
Parameters:
-
plane
BABYLON.Vector3bottom plane of the roof (same as subslope extended plane).
-
roof
RoofStructureThe current roof.
-
withGable
BooleanIf true then extend at gable overhang too.
-
withOverhang
BooleanIf true then extend at overhang too.
Returns:
the extended bottom plane of the roof
getFloor
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.
getRoofPoints
Syntax
getRoofPoints
-
roof
-
force
Summary
Returns 3D points of bottom roof plane
Parameters:
-
roof
RoofStructureThe current roof
-
force
Booleanif true then recompute the points, else return stored roofPoints3D
Returns:
points of roof in 3D
getYForPoint
Syntax
Summary
Returns 3D Y-coordinate of a 2D point when elevated to the intersection with the roof plane
Parameters:
-
point
BABYLON.Vector22D point for which we want the Y coordinate in 3D
-
roof
RoofStructureThe current roof
Returns:
Y coordinate of point 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
onSubslopesReady
Syntax
onSubslopesReady
-
event
Summary
Triggered on event wnp.engine3D.subslopesReady
.
Adds roofs to the walls mesh.
Parameters:
-
event
EventThe JS event.
startListening
Syntax
startListening
()
Summary
Calls all the event listeners.stopListening
Syntax
stopListening
()
Summary
Removes all the event listeners.triangulatePoints
Syntax
Summary
Triangulates polygon points.
Parameters:
-
points
BABYLON.Vector3the points of the polygon to triangulate
Returns:
triangulation indices
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.roofsReady
Syntax
wnp.engine3D.roofsReady
Summary
Fired when the roofs have been 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 roofs carve the wall mesh when built).