SpiralStairwayStructure
Summary
Stairway structure for the spiral stairway.
Constructor
SpiralStairwayStructure
Syntax
SpiralStairwayStructure
()
Summary
Item Index
Methods
Methods
add
Syntax
add
(
private
-
propertyName
-
value
Summary
Adds an element to the collection in parameter.Returns:
Returns true if the value is added else returns false.
addMaterial
Syntax
addMaterial
(
private
-
parent
-
mesh
-
materialItem
Summary
Adds a material.Parameters:
-
parent
BABYLON.MeshThe parent of the mesh. -
mesh
BABYLON.MeshThe stairway mesh. -
materialItem
wnp.StandardMaterialThe item material.
computeSpiralPoints
Syntax
computeSpiralPoints
()
private
Summary
Computes the points of the spiral stairway.
deserialize
Syntax
Summary
Deserializes the object (from JSON).Parameters:
-
hybrid
ObjectJSON describing the object, built with the method serialize.
Returns:
Object:
The Structure object built from the deserialization
draw
Syntax
draw
(
private
-
ctx
-
_temp
Summary
Draws the spiral stairway.
Parameters:
-
ctx
CanvasRenderingContext2DContext 2D of the canvas.
-
_temp
BABYLON.Vector2The temporary position of the stairway.
getAvailableProperties
Syntax
Summary
Gets the available properties of the object (user-customizable).Returns:
Object[]:
An array containing several properties of the object.
getElementByName
Syntax
Summary
Gets an element of the collection by its name.Parameters:
Returns:
Object:
Returns the needed element if it exists, else returns null.
getFloor
Syntax
Summary
Gets the floor referencing this objectParameters:
-
collection
StringCollection to search within.
Returns:
FloorStructure:
The floor containing this structure, -1 if the object has not been added to any floor collection.
getHopperPoints
Syntax
getHopperPoints
()
BABYLON.Vector2
Summary
Gets the point of the hopper in the upper floor, induced by the stairway.
Returns:
BABYLON.Vector2:
The points of the hopper.
getNormalAtPoint
Syntax
getNormalAtPoint
(
BABYLON.Vector3
deprecated
-
index
Summary
Gets the normal at the given index point.Parameters:
-
index
NumberThe index of the point.
Returns:
BABYLON.Vector3:
The normal at the point.
getStepBoundPoints
Syntax
getStepBoundPoints
(
BABYLON.Vector3
private
-
bottomIndex
Summary
Returns the 4 points of the step.Parameters:
-
bottomIndex
NumberThe index of the bottom point of the step.
Returns:
BABYLON.Vector3:
The four points of a step.
initialize
Syntax
initialize
()
private
Summary
Method called after the loading of the componentremove
Syntax
remove
(
-
structure
Summary
Deletes the stairway.Parameters:
-
structure
FloorStructureThe structure of the floor.
serialize
Syntax
Summary
Serializes the object (to JSON)Returns:
Object:
The serialization result, null if nothing is serialized
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