HopperComponent3D Class
3D Hopper component which handles the 3D rendering of the hopper.
Constructor
HopperComponent3D
-
core
Parameters:
-
core
CoreWanaplan Core.
Item Index
Methods
Properties
Methods
applyShadow
-
object3D
Enables the shadows for all children of a mesh.
Parameters:
-
object3D
BABYLON.MeshThe 3D mesh.
Build
-
room3d
-
hopper
-
[height=0]
-
[heightM=100]
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
()
private
createHopperSticks
-
hopper
-
scene
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
()
private
decorate
-
material
-
collisionInfo
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
()
disable
()
enable
()
getDefaultMaterials
-
scene
The default materials of the hoppers.
Parameters:
-
scene
BABYLON.SceneThe scene ( mandatory to create a material ).
Returns:
The materials.
getFloor
-
[structure]
Parameters:
-
[structure]
FloorStructure optionalThe floor structure.
Returns:
The floor mesh in 3D.
initialize
()
initMaterials
-
object3d
-
materials
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
-
object
-
scene
Merges the components of a rail guard.
Parameters:
-
object
BABYLON.MeshThe objects to merge.
-
scene
BABYLON.SceneThe scene.
onContextChanged
-
context
Parameters:
-
context
StringThe new context
startListening
()
stopListening
()
update
-
deltaTime
Parameters:
-
deltaTime
NumberThe time interval.
Properties
_commonHopperMaterial
BABYLON.Material
private
Material on the hopper hole.
Default: White material
keyboardManager
wnp.KeyboardManager
roomcmp3D
RoomComponent3D
The 3D hopper component needs the RoomComponent3D to get information about the room.
Default: null