API Docs for: 2.7.3
Show:

HopperComponent3D Class

Extends BaseComponent3D
Module: Component
Parent Module: Wanaplan

3D Hopper component which handles the 3D rendering of the hopper.

Constructor

HopperComponent3D

(
  • core
)

Parameters:

  • core Core

    Wanaplan Core.

Methods

applyShadow

(
  • object3D
)
private

Enables the shadows for all children of a mesh.

Parameters:

  • object3D BABYLON.Mesh

    The 3D mesh.

Build

(
  • room3d
  • hopper
  • [height=0]
  • [heightM=100]
)
BABYLON.Mesh static

Builds the hopper. Carves the hopper into the room floor and adds the sticks ( rail guard ).

Parameters:

  • room3d BABYLON.Mesh

    The room mesh where the hopper will be built.

  • hopper HopperStructure

    The hopper structure.

  • [height=0] Number optional

    The height position from where the hopper will be created, basically it's either 0 to carve the floor or the room height to carve the ceiling.

  • [heightM=100] Number optional

    The maximum height to carve above the hopper.

Returns:

BABYLON.Mesh:

The room mesh with the hopper.

compute

() private

Inherited from BaseComponent3D:

Recompute of the component.

createHopperSticks

(
  • hopper
  • scene
)
Boolean

Builds the mesh that represents the sticks ( rail guard ) of the hopper structure passed in argument.

Parameters:

  • hopper HopperStructure

    The hopper structure.

  • scene BABYLON.Scene

    The scene ( mandatory to create a mesh ).

Returns:

Boolean:

False.

Debug

() private

decorate

(
  • material
  • collisionInfo
)
private

Applies the texture to the pointed part of the object. For the hopper, the decorable parts are the inner planes of the hole and the sticks ( rail guards ).

/!\ This function is meant to be used in the context of the BABYLON.Mesh and will be used in a strict flow. It's not meant to be used outside this flow and is therefore tagged as private.

Parameters:

  • material Material

    The material of the decoration.

  • collisionInfo BABYLON.CollisionInfo

    The information about the picked mesh.

destroy

()

Inherited from BaseComponent3D:

Destructor.

disable

()

Inherited from BaseComponent3D:

Disables the component

enable

()

Inherited from BaseComponent3D:

Enables the component

getDefaultMaterials

(
  • scene
)
Material private

The default materials of the hoppers.

Parameters:

  • scene BABYLON.Scene

    The scene ( mandatory to create a material ).

Returns:

Material:

The materials.

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.

initMaterials

(
  • object3d
  • materials
)
private

Sets the materials of the hopper using the traverse function.

Parameters:

  • object3d BABYLON.Mesh

    The 3D mesh.

  • materials Material

    The materials to add to the 3D mesh.

mergeGeometries

(
  • object
  • scene
)
private

Merges the components of a rail guard.

Parameters:

  • object BABYLON.Mesh

    The objects to merge.

  • scene BABYLON.Scene

    The scene.

onContextChanged

(
  • context
)

Inherited from BaseComponent3D:

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

Parameters:

  • context String
    The new context

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

_commonHopperMaterial

BABYLON.Material private

Material on the hopper hole.

Default: White material

keyboardManager

wnp.KeyboardManager

Inherited from BaseComponent3D:

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

name

String

Inherited from BaseComponent3D:

Name of the component.

roomcmp3D

RoomComponent3D

The 3D hopper component needs the RoomComponent3D to get information about the room.

Default: null

structure

wnp.Structure

Inherited from BaseComponent3D:

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