HopperComponent3D
Summary
3D Hopper component which handles the 3D rendering of the hopper.
Constructor
HopperComponent3D
Syntax
HopperComponent3D
-
core
Summary
Parameters:
-
core
CoreWanaplan Core.
Item Index
Methods
Properties
Methods
applyShadow
Syntax
applyShadow
-
object3D
Summary
Enables the shadows for all children of a mesh.
Parameters:
-
object3D
BABYLON.MeshThe 3D mesh.
Build
Syntax
Build
-
room3d
-
hopper
-
[height=0]
-
[heightM=100]
Summary
Builds the hopper. Carves the hopper into the room floor and adds the sticks ( rail guard ).
Parameters:
-
room3d
BABYLON.MeshThe room mesh where the hopper will be built.
-
hopper
HopperStructureThe hopper structure.
-
[height=0]
Number optionalThe 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 optionalThe maximum height to carve above the hopper.
Returns:
The room mesh with the hopper.
compute
Syntax
compute
()
private
Summary
Recompute of the component.createHopperSticks
Syntax
Summary
Builds the mesh that represents the sticks ( rail guard ) of the hopper structure passed in argument.
Parameters:
-
hopper
HopperStructureThe hopper structure.
-
scene
BABYLON.SceneThe scene ( mandatory to create a mesh ).
Returns:
False.
Debug
Syntax
Debug
()
private
Summary
decorate
Syntax
decorate
-
material
-
collisionInfo
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
MaterialThe material of the decoration.
-
collisionInfo
BABYLON.CollisionInfoThe information about the picked mesh.
destroy
Syntax
destroy
()
Summary
Destructor.disable
Syntax
disable
()
Summary
Disables the componentenable
Syntax
enable
()
Summary
Enables the componentgetDefaultMaterials
Syntax
getDefaultMaterials
-
scene
Summary
The default materials of the hoppers.
Parameters:
-
scene
BABYLON.SceneThe scene ( mandatory to create a material ).
Returns:
The materials.
getFloor
Syntax
getFloor
-
[structure]
Summary
Gets the 3D mesh of the floor structure in parameter (by default current floor).Parameters:
-
[structure]
FloorStructure optionalThe floor structure.
Returns:
The floor mesh in 3D.
initialize
Syntax
initialize
()
Summary
Method called when Wanaplan is initialized. You don't need to call this method manually.initMaterials
Syntax
initMaterials
-
object3d
-
materials
Summary
Sets the materials of the hopper using the traverse function.
Parameters:
-
object3d
BABYLON.MeshThe 3D mesh.
-
materials
MaterialThe materials to add to the 3D mesh.
mergeGeometries
Syntax
mergeGeometries
-
object
-
scene
Summary
Merges the components of a rail guard.
Parameters:
-
object
BABYLON.MeshThe objects to merge.
-
scene
BABYLON.SceneThe scene.
onContextChanged
Syntax
onContextChanged
-
context
Summary
Method called when the context is switched (2D -> 3D or 3D -> 2D)Parameters:
-
context
StringThe new context
startListening
Syntax
startListening
()
Summary
Calls all the event listeners.stopListening
Syntax
stopListening
()
Summary
Removes all the event listeners.update
Syntax
update
-
deltaTime
Summary
Updates the dynamic part of the component.Parameters:
-
deltaTime
NumberThe time interval.
Properties
_commonHopperMaterial
Syntax
_commonHopperMaterial
BABYLON.Material
private
Summary
Material on the hopper hole.
Default: White material
keyboardManager
Syntax
keyboardManager
wnp.KeyboardManager
Summary
Instance of the Keyboard Manager (shortcut to wanaplan.keyboardManager).roomcmp3D
Syntax
roomcmp3D
RoomComponent3D
Summary
The 3D hopper component needs the RoomComponent3D to get information about the room.
Default: null