RoofComponent3D Class
RoofComponent3D.
Constructor
RoofComponent3D
-
core
Parameters:
-
core
CoreThe main engine.
Item Index
Methods
Properties
Events
Methods
addRoof
-
wallMesh
-
roof
-
structure
-
sceneF
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
-
roof
-
point
-
structure
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
()
private
destroy
()
disable
()
enable
()
extendRoof
-
plane
-
roof
-
withGable
-
withOverhang
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
-
[structure]
Parameters:
-
[structure]
FloorStructure optionalThe floor structure.
Returns:
The floor mesh in 3D.
getRoofPoints
-
roof
-
force
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
-
point
-
roof
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
()
onContextChanged
-
context
Parameters:
-
context
StringThe new context
onSubslopesReady
-
event
Triggered on event wnp.engine3D.subslopesReady
.
Adds roofs to the walls mesh.
Parameters:
-
event
EventThe JS event.
startListening
()
stopListening
()
triangulatePoints
-
points
Triangulates polygon points.
Parameters:
-
points
BABYLON.Vector3the points of the polygon to triangulate
Returns:
triangulation indices
update
-
deltaTime
Parameters:
-
deltaTime
NumberThe time interval.
Properties
keyboardManager
wnp.KeyboardManager
structure
wnp.Structure
Events
wnp.engine3D.roofsReady
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).