SwimmingPoolStructure Class
SwimmingPool's structure.
Constructor
SwimmingPoolStructure
()
Item Index
Methods
Methods
add
-
propertyName
-
value
Returns:
addMaterial
-
parent
-
mesh
-
materialItem
Adds a material.
Parameters:
-
parent
BABYLON.MeshThe parent of the mesh.
-
mesh
BABYLON.MeshThe stairway mesh.
-
materialItem
wnp.StandardMaterialThe item material.
checkCoherence
-
targetPoint
-
targetSide
Checks the coherence of swimmingPool's bassin.
Parameters:
Returns:
True if the swimmingPool is coherent.
checkCoherence
-
targetPoint
-
targetSide
Checks the coherence of swimmingPool's points.
Parameters:
Returns:
True if the swimmingPool is coherent.
deserialize
-
hybrid
Parameters:
-
hybrid
ObjectJSON describing the object, built with the method serialize.
Returns:
The Structure object built from the deserialization
getAvailableProperties
()
Array
Returns the user-customizable properties of this swimmingPool.
Returns:
Properties.
getElementByName
-
name
-
collection
Parameters:
Returns:
getFloor
-
collection
Parameters:
-
collection
StringCollection to search within.
Returns:
The floor containing this structure, -1 if the object has not been added to any floor collection.
getWidthLength
-
isLength
Sets width or length of the swimmingPool.
Parameters:
-
isLength
Booleanif it is length or width.
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 swimmingPool.
Returns:
False if the structure is corrupted, true otherwise.
move
-
moveVector
Moves the swimmingPool by the translation vector passed in params ( relative move ).
Parameters:
-
moveVector
BABYLON.Vector2The translation vector by which the swimmingPool will by moved.
remove
-
structure
Removes the swimmingPool.
Parameters:
-
structure
FloorStructureThe structure from which the swimmingPool must be removed.
rotate
-
moveVector
Rotate the swimmingPool in 2D.
Parameters:
-
moveVector
BABYLON.Vector2move of the mouse.
serialize
()
Object
Returns:
setBassinPosition
()
Sets the position in 2D of the swimmingPool's bassin.
setPoints
()
Sets vertices of the swimmingPool.
setPointsByMeasure
-
isLength
-
newValue
Sets vertices of the swimmingPool'tickness.
setRotateTarget
()
Sets the position in 2D of the swimmingPool's rotating ring.
setThicknessPoints
()
Sets vertices of the swimmingPool'tickness.
update
()
updateReferences
-
structure
Parameters:
-
structure
wnp.StructureFloor Structure to work with
Properties
materials
BABYLON.Material
Set of labeled materials used for painting the swimmingPool.
The decorable meshes are:
- font
- thicknessMesh
modified
Boolean
Indicates if the swimmingPool has been modified or if it's the default swimmingPool.
Default: false
points
BABYLON.Vector2
The vertices of the swimmingPool. Points can be moved, added ( a swimmingPool 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 ] ).