FloorComponent3D Class
This component is responsible for handling the floor mesh containers in 3D.
Constructor
FloorComponent3D
-
core
Parameters:
-
core
CoreWanaplan Core.
Item Index
Methods
Properties
Methods
compute
()
private
createFloor
-
[start=0]
Builds the floors :
- retrieve the currently selected floor.
- delete the floors above the currently selected one.
- rebuild all the floors between the start floor (passed in params) and the currently selected one.
Parameters:
-
[start=0]
Number optionalThe floor id to be built. If omitted, start from the first one (0).
createFloorMesh
-
element
Builds a floor mesh (empty).
Parameters:
-
element
ObjectThe structure of the floor.
Returns:
the mesh built.
deleteFloor
-
floor
Deletes a floor from the scene. This disposes of the mesh of this floor AND ALL FLOORS ABOVE. TODO : weird behaviour, will be changed.
Parameters:
-
floor
FloorStructureThe floor structure.
destroy
()
disable
()
enable
()
getFloor
-
[element]
Gets the mesh associated with the floor structure.
Parameters:
-
[element]
FloorStructure optionalThe structure of the floor. If omitted, use the currently selected floor.
Returns:
The mesh associated to the floor structure.
initialize
()
onContextChanged
-
context
Parameters:
-
context
StringThe new context
onNewPlanReady
-
event
Called when the plan is ready.
Will delete the whole structure mesh.
Triggered on wnp.request.newPlanReady
.
Parameters:
-
event
EventThe event.
onSelectFloor
-
event
Called when the floor is selected.
Triggered on event wnp.request.floorSelected
Parameters:
-
event
EventThe event.
onSelectFloor
-
event
Called when the floor needs to be deleted.
Triggered on event wnp.request.floorDeleted
.
Parameters:
-
event
EventThe event.
startListening
()
stopListening
()
update
-
deltaTime
Parameters:
-
deltaTime
NumberThe time interval.
Properties
keyboardManager
wnp.KeyboardManager
structure
wnp.Structure
Events
wnp.engine3D.allFloorsReady
Fired when all floors are ready.
wnp.engine3D.floorReady
Fired when a floor is ready.