WanaPlan

API Docs for: 2.7.0
Show:

FloorComponent3D

Extends BaseComponent3D
Module: Component
Parent Module: Wanaplan

Summary

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

Constructor

FloorComponent3D

Syntax

FloorComponent3D

(
  • core
)

Summary

Parameters:

  • core Core

    Wanaplan Core.

Methods

compute

Inherited from BaseComponent3D:

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 optional

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

createFloorMesh

Syntax

createFloorMesh

(
  • element
)
BABYLON.Mesh

Summary

Builds a floor mesh (empty).

Parameters:

  • element Object

    The structure of the floor.

Returns:

BABYLON.Mesh:

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:

destroy

Inherited from BaseComponent3D:

Syntax

destroy

()

Summary

Destructor.

disable

Inherited from BaseComponent3D:

Syntax

disable

()

Summary

Disables the component

enable

Inherited from BaseComponent3D:

Syntax

enable

()

Summary

Enables the component

getFloor

Inherited from BaseComponent3D

Syntax

getFloor

(
  • [element]
)
BABYLON.Mesh

Summary

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:

Syntax

initialize

()

Summary

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

onContextChanged

Inherited from BaseComponent3D:

Syntax

onContextChanged

(
  • context
)

Summary

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

Parameters:

  • context String
    The new context

onNewPlanReady

Syntax

onNewPlanReady

(
  • event
)
private

Summary

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

Parameters:

  • event Event

    The event.

onSelectFloor

Syntax

onSelectFloor

(
  • event
)
private

Summary

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

Parameters:

  • event Event

    The event.

onSelectFloor

Syntax

onSelectFloor

(
  • event
)
private

Summary

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

Parameters:

  • event Event

    The event.

startListening

Inherited from BaseComponent3D:

Syntax

startListening

()

Summary

Calls all the event listeners.

stopListening

Inherited from BaseComponent3D:

Syntax

stopListening

()

Summary

Removes all the event listeners.

update

Inherited from BaseComponent3D:

Syntax

update

(
  • deltaTime
)

Summary

Updates the dynamic part of the component.

Parameters:

  • deltaTime Number
    The time interval.

Properties

keyboardManager

Inherited from BaseComponent3D:

Syntax

keyboardManager

wnp.KeyboardManager

Summary

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

name

Inherited from BaseComponent3D:

Syntax

name

String

Summary

Name of the component.

structure

Inherited from BaseComponent3D:

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.