FloorComponent3D
Summary
This component is responsible for handling the floor mesh containers in 3D.
Constructor
FloorComponent3D
Syntax
FloorComponent3D
-
core
Summary
Parameters:
-
core
CoreWanaplan Core.
Item Index
Methods
Properties
Methods
compute
Syntax
compute
()
private
Summary
Recompute of the component.createFloor
Syntax
createFloor
-
[start=0]
Summary
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
Syntax
createFloorMesh
-
element
Summary
Builds a floor mesh (empty).
Parameters:
-
element
ObjectThe structure of the floor.
Returns:
the mesh built.
deleteFloor
Syntax
deleteFloor
-
floor
Summary
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
Syntax
destroy
()
Summary
Destructor.disable
Syntax
disable
()
Summary
Disables the componentenable
Syntax
enable
()
Summary
Enables the componentgetFloor
Syntax
getFloor
-
[element]
Summary
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
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
onNewPlanReady
Syntax
onNewPlanReady
-
event
Summary
Called when the plan is ready.
Will delete the whole structure mesh.
Triggered on wnp.request.newPlanReady
.
Parameters:
-
event
EventThe event.
onSelectFloor
Syntax
onSelectFloor
-
event
Summary
Called when the floor is selected.
Triggered on event wnp.request.floorSelected
Parameters:
-
event
EventThe event.
onSelectFloor
Syntax
onSelectFloor
-
event
Summary
Called when the floor needs to be deleted.
Triggered on event wnp.request.floorDeleted
.
Parameters:
-
event
EventThe 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.allFloorsReady
Syntax
wnp.engine3D.allFloorsReady
Summary
Fired when all floors are ready.
wnp.engine3D.floorReady
Syntax
wnp.engine3D.floorReady
Summary
Fired when a floor is ready.