API Docs for: 2.7.3
Show:

GridComponent3D Class

Extends BaseComponent3D
Module: Wanaplan

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

Constructor

GridComponent3D

(
  • core
)

Parameters:

  • core Core

    Wanaplan Core.

Methods

carveGroundWithFloor

(
  • extrooms
  • elevation
)

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

(
  • hoppers
)

Carves the grid with hoppers.

Parameters:

compute

() private

Inherited from BaseComponent3D:

Recompute of the component.

createGround

(
  • [params]
)

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

(
  • [params]
)

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:

Destructor.

disable

()

Inherited from BaseComponent3D:

Disables the component

enable

()

Inherited from BaseComponent3D:

Enables the component

getFloor

(
  • [structure]
)
BABYLON.Mesh

Inherited from BaseComponent3D:

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:

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

isDefaultSkybox

() Boolean

Indicates if the default sky is set.

Returns:

Boolean:

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

onChangeGround

(
  • event
)

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

Parameters:

onChangeSky

(
  • event
)

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

Parameters:

onContextChanged

(
  • context
)

Inherited from BaseComponent3D:

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

Parameters:

  • context String

    The new context

onStructureLoaded

(
  • event
)

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

()

Sets the default ground.

setupFog

()

Setups the fog in the scene.

setupLights

()

Setups the lights in the scene.

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

Fired to request a save of the history.