WanaPlan

API Docs for: 2.7.0
Show:

GridComponent3D

Extends BaseComponent3D
Module: Wanaplan

Summary

This component manages the whole 3D environnement, specifically the 3D grid, the skybox, and the lights.

Constructor

GridComponent3D

Syntax

GridComponent3D

(
  • core
)

Summary

Parameters:

  • core Core

    Wanaplan Core.

Methods

carveGroundWithFloor

Syntax

carveGroundWithFloor

(
  • extrooms
  • elevation
)

Summary

Carves the grid and earth with the shape of a floor.

Parameters:

  • extrooms RoomStructure[]

    External rooms of the floor to carve into the ground.

  • elevation Number

    The elevation of the floor

carveGroundWithHoppers

Syntax

carveGroundWithHoppers

(
  • hoppers
)

Summary

Carves the grid with hoppers.

Parameters:

compute

Inherited from BaseComponent3D:

Syntax

compute

() private

Summary

Recompute of the component.

createGround

Syntax

createGround

(
  • [params]
)

Summary

Creates the ground and applies the grid material. If the ground already exists, it is kept but the material is destroyed and recreated.

Parameters:

  • [params] Object optional

    An object which can contain in params.url a ground texture URL.

createSky

Syntax

createSky

(
  • [params]
)

Summary

Creates the sky according to parameter URL. If no URL is specified then the default Skybox is created. For compatibility reason, a skysphere can be generated instead of a skybox.

Parameters:

  • [params] Object optional

    params.url can be the URL of an asset to use for the sky creation.

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

(
  • [structure]
)
BABYLON.Mesh

Summary

Gets the 3D mesh of the floor structure in parameter (by default current floor).

Parameters:

Returns:

BABYLON.Mesh:

The floor mesh in 3D.

initialize

Inherited from BaseComponent3D:

Syntax

initialize

()

Summary

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

isDefaultSkybox

Syntax

isDefaultSkybox

() Boolean

Summary

Indicates if the default sky is set.

Returns:

Boolean:

Returns true if the default sky is set, otherwise it returns false.

onChangeGround

Syntax

onChangeGround

(
  • event
)

Summary

Changes the aspect of the ground. Triggered on wnp.engine3D.changeGround

Parameters:

onChangeSky

Syntax

onChangeSky

(
  • event
)

Summary

Changes the aspect of the sky. Triggered on wnp.engine3D.changeSky

Parameters:

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

onStructureLoaded

Syntax

onStructureLoaded

(
  • event
)

Summary

Creates the sky and the ground if a previous configuration exists. Triggered on event wnp.core.structure.loaded

Parameters:

  • event Event

    The event object

setDefaultGround

Syntax

setDefaultGround

()

Summary

Sets the default ground.

setupFog

Syntax

setupFog

()

Summary

Setups the fog in the scene.

setupLights

Syntax

setupLights

()

Summary

Setups the lights in the scene.

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.request.saveHistory

Syntax

wnp.request.saveHistory

Summary

Fired to request a save of the history.