OvertureStructure Class
Overture structure.
Constructor
OvertureStructure
()
Item Index
Methods
Methods
add
-
propertyName
-
value
Returns:
checkCoherence
-
structure
Checks the coherence of all the parameters.
Parameters:
-
structure
OvertureStructureThe overture structure.
clampSize
-
allowDelete
-
structure
Resizes the overture in function of the parent wall.
Parameters:
-
allowDelete
BooleanSpecifies if we allow the deletion if the size of the wall is to small.
-
structure
FloorStructureThe current floor structure. Must be specified if allowDelete == true.
computePositionOnWallChange
-
newWall
Computes the new position of the overture when its parent wall is merged with another one.
Parameters:
-
newWall
WallStructureThe new wall of the overture.
Returns:
The new position.
deserialize
-
hybrid
Parameters:
-
hybrid
ObjectJSON describing the object, built with the method serialize.
Returns:
getAbsolutePos
()
Object
Returns a pair of elements: the position of the center of the overture and the unit vector of the parent wall.
Returns:
position: BABYLON.Vector3, vector: BABYLON.Vector3 The position and the unit vector.
getAvailableProperties
()
Array
Returns the user-customizable properties of this overture.
Returns:
Properties.
getElementByName
-
name
-
collection
Parameters:
Returns:
getFloor
-
collection
Parameters:
-
collection
StringCollection to search within.
Returns:
getMaterial
-
name
Gets a material from the list.
Parameters:
-
name
StringThe name of the material to fetch.
Returns:
The material.
getParentWall
()
WallStructure
Gets the parent wall of the overture.
Returns:
The parent of the overture.
getPolygon
()
BABYLON.Vector2
Returns the polygon describing the overture.
Returns:
The array of the points of the polygon.
guessSide
-
mousePosition
Tries to guess the overture direction given the adjacent rooms situations.
Parameters:
-
mousePosition
BABYLON.Vector2The position of the mouse.
initialize
()
private
projectOnWall
()
Projects the position of the overture on its parent wall.
remove
-
structure
Deletes the overture.
Parameters:
-
structure
FloorStructureThe floor from which the engine has to remove the overture.
serialize
()
Object
Returns:
setMaterial
-
material
-
name
Adds/replaces the material with the given name to the list of materials.
Parameters:
-
material
MaterialThe new material.
-
name
StringThe name of the new material.
setParentWall
-
wall
Sets the parent wall of the overture.
Parameters:
-
wall
WallStructureThe new parent of the overture.
update
()
updateReferences
-
structure
Parameters:
-
structure
wnp.StructureFloor Structure to work with
Properties
hinge
Number
Defines the side of the overture where the hinges should be displayed (0 = right, 1 = left).
position
BABYLON.Vector2
Position of the overture.
programmableInstance
BABYLON.Mesh
The instance of the programmable.
side
Number
Defines the side of the room where the hinges should be displayed ( inside / outside of the room ). Availables values are -1 or 1
type
String
Type of the overture. Availables values are "Door" , "Window" , "Garage" , "Velux" , "Dormer"