API Docs for: 2.7.3
Show:

FloorComponent3D Class

Extends BaseComponent3D
Module: Component
Parent Module: Wanaplan

This component is responsible for handling the floor mesh containers in 3D.

Constructor

FloorComponent3D

(
  • core
)

Parameters:

  • core Core

    Wanaplan Core.

Methods

compute

() private

Inherited from BaseComponent3D:

Recompute of the component.

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 optional

    The floor id to be built. If omitted, start from the first one (0).

createFloorMesh

(
  • element
)
BABYLON.Mesh

Builds a floor mesh (empty).

Parameters:

  • element Object

    The structure of the floor.

Returns:

BABYLON.Mesh:

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:

destroy

()

Inherited from BaseComponent3D:

Destructor.

disable

()

Inherited from BaseComponent3D:

Disables the component

enable

()

Inherited from BaseComponent3D:

Enables the component

getFloor

(
  • [element]
)
BABYLON.Mesh

Inherited from BaseComponent3D

Gets the mesh associated with the floor structure.

Parameters:

  • [element] FloorStructure optional

    The structure of the floor. If omitted, use the currently selected floor.

Returns:

BABYLON.Mesh:

The mesh associated to the floor structure.

initialize

()

Inherited from BaseComponent3D:

Method called when Wanaplan is initialized. You don't need to call this method manually.

onContextChanged

(
  • context
)

Inherited from BaseComponent3D:

Method called when the context is switched (2D -> 3D or 3D -> 2D)

Parameters:

  • context String
    The new context

onNewPlanReady

(
  • event
)
private

Called when the plan is ready. Will delete the whole structure mesh. Triggered on wnp.request.newPlanReady.

Parameters:

onSelectFloor

(
  • event
)
private

Called when the floor is selected. Triggered on event wnp.request.floorSelected

Parameters:

onSelectFloor

(
  • event
)
private

Called when the floor needs to be deleted. Triggered on event wnp.request.floorDeleted.

Parameters:

startListening

()

Inherited from BaseComponent3D:

Calls all the event listeners.

stopListening

()

Inherited from BaseComponent3D:

Removes all the event listeners.

update

(
  • deltaTime
)

Inherited from BaseComponent3D:

Updates the dynamic part of the component.

Parameters:

  • deltaTime Number
    The time interval.

Properties

keyboardManager

wnp.KeyboardManager

Inherited from BaseComponent3D:

Instance of the Keyboard Manager (shortcut to wanaplan.keyboardManager).

name

String

Inherited from BaseComponent3D:

Name of the component.

structure

wnp.Structure

Inherited from BaseComponent3D:

Instance of the structure (shortcut to wanaplan.structure).

Events

wnp.engine3D.allFloorsReady

Fired when all floors are ready.

wnp.engine3D.floorReady

Fired when a floor is ready.