WanaPlan

API Docs for: 2.7.0
Show:

HopperComponent3D

Extends BaseComponent3D
Module: Component
Parent Module: Wanaplan

Summary

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

Constructor

HopperComponent3D

Syntax

HopperComponent3D

(
  • core
)

Summary

Parameters:

  • core Core

    Wanaplan Core.

Methods

applyShadow

Syntax

applyShadow

(
  • object3D
)
private

Summary

Enables the shadows for all children of a mesh.

Parameters:

  • object3D BABYLON.Mesh

    The 3D mesh.

Build

Syntax

Build

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

Summary

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

Inherited from BaseComponent3D:

Syntax

compute

() private

Summary

Recompute of the component.

createHopperSticks

Syntax

createHopperSticks

(
  • hopper
  • scene
)
Boolean

Summary

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

Syntax

Debug

() private

Summary

decorate

Syntax

decorate

(
  • material
  • collisionInfo
)
private

Summary

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:

Syntax

destroy

()

Summary

Destructor.

disable

Inherited from BaseComponent3D:

Syntax

disable

()

Summary

Disables the component

enable

Inherited from BaseComponent3D:

Syntax

enable

()

Summary

Enables the component

getDefaultMaterials

Syntax

getDefaultMaterials

(
  • scene
)
Material private

Summary

The default materials of the hoppers.

Parameters:

  • scene BABYLON.Scene

    The scene ( mandatory to create a material ).

Returns:

Material:

The materials.

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.

initMaterials

Syntax

initMaterials

(
  • object3d
  • materials
)
private

Summary

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

Syntax

mergeGeometries

(
  • object
  • scene
)
private

Summary

Merges the components of a rail guard.

Parameters:

  • object BABYLON.Mesh

    The objects to merge.

  • scene BABYLON.Scene

    The scene.

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

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

_commonHopperMaterial

Syntax

_commonHopperMaterial

BABYLON.Material private

Summary

Material on the hopper hole.

Default: White material

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.

roomcmp3D

Syntax

roomcmp3D

RoomComponent3D

Summary

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

Default: null

structure

Inherited from BaseComponent3D:

Syntax

structure

wnp.Structure

Summary

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