HopperStructure
Summary
Hopper's structure.
Constructor
HopperStructure
Syntax
HopperStructure
-
[points]
Summary
Parameters:
-
[points]
BABYLON.Vector2 optionalThe polygon which defines the hopper shape, default is a 100cm large square.
Item Index
Methods
Methods
add
Syntax
add
-
propertyName
-
value
Summary
Adds an element to the collection in parameter.Returns:
deserialize
Syntax
Summary
Deserializes the object (from JSON).Parameters:
-
hybrid
ObjectJSON describing the object, built with the method serialize.
Returns:
getElementByName
Syntax
Summary
Gets an element of the collection by its name.Parameters:
Returns:
getFloor
Syntax
Summary
Gets the floor referencing this objectParameters:
-
collection
StringCollection to search within.
Returns:
initialize
Syntax
initialize
()
private
Summary
Method called after the loading of the componentinserPointAt
Syntax
inserPointAt
-
The
-
The
Summary
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
Syntax
Summary
Checks the consistency of the hopper.
Returns:
False if the structure is corrupted, true otherwise.
move
Syntax
move
-
moveVector
Summary
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
Syntax
remove
-
structure
Summary
Removes the hopper.
Parameters:
-
structure
FloorStructureThe structure from which the hopper must be removed.
serialize
Syntax
Summary
Serializes the object (to JSON)Returns:
update
Syntax
update
()
Summary
Generic update method, must be overridden.updateReferences
Syntax
updateReferences
-
structure
Summary
Generic method for rebuilding references after the deserialization. For example : restoring the link between a PointStructure and its parent WallStructureParameters:
-
structure
wnp.StructureFloor Structure to work with
Properties
materials
Syntax
materials
BABYLON.Material
Summary
Set of labeled materials used for painting the hopper.
The decorable meshes are:
- rail_stick
- rails
- bas
modified
Syntax
modified
Boolean
Summary
Indicates if the hopper has been modified or if it's the default hopper.
Default: false
points
Syntax
points
BABYLON.Vector2
Summary
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
Syntax
stairwayId
String
Summary
If the hopper is associated with a stairway, the stairway id ( null otherwise ).
Default: null
sticks
Syntax
sticks
Boolean[]
Summary
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.