HopperStructure Class
Hopper's structure.
Constructor
HopperStructure
-
[points]
Parameters:
-
[points]
BABYLON.Vector2 optionalThe polygon which defines the hopper shape, default is a 100cm large square.
Item Index
Methods
Methods
add
-
propertyName
-
value
Returns:
deserialize
-
hybrid
Parameters:
-
hybrid
ObjectJSON describing the object, built with the method serialize.
Returns:
getElementByName
-
name
-
collection
Parameters:
Returns:
getFloor
-
collection
Parameters:
-
collection
StringCollection to search within.
Returns:
initialize
()
private
inserPointAt
-
The
-
The
Inserts a point at a given index.
Parameters:
-
The
Numberindex where the point must be inserted in the array of points.
-
The
BABYLON.Vector2inserted point.
isValid
()
Boolean
Checks the consistency of the hopper.
Returns:
False if the structure is corrupted, true otherwise.
move
-
moveVector
Moves the hopper by the translation vector passed in params ( relative move ).
Parameters:
-
moveVector
BABYLON.Vector2The translation vector by which the hopper will by moved.
remove
-
structure
Removes the hopper.
Parameters:
-
structure
FloorStructureThe structure from which the hopper must be removed.
serialize
()
Object
Returns:
update
()
updateReferences
-
structure
Parameters:
-
structure
wnp.StructureFloor Structure to work with
Properties
materials
BABYLON.Material
Set of labeled materials used for painting the hopper.
The decorable meshes are:
- rail_stick
- rails
- bas
modified
Boolean
Indicates if the hopper has been modified or if it's the default hopper.
Default: false
points
BABYLON.Vector2
The vertices of the hopper. By default, the hopper is a 100cm large square. Points can be moved, added ( a hopper can have more than 4 vertices ), and removed ( as long as there is still at least 3 vertices ).
Note that when we refer to the side i, it is the edge ( points[ i ] , points[ i+1 ] ).
stairwayId
String
If the hopper is associated with a stairway, the stairway id ( null otherwise ).
Default: null
sticks
Boolean[]
Indicates which sides of the hopper should have a guardrail. It is an object with a boolean for each side. example : { 0 : false, // Side 0 has no guardrail 1 : true, // whereas side 1 has one ... };
Default: { 0:false , 1:false , 2:false , 3:false } A hopper without guardrails.