FloorStructure Class
Floor.
Constructor
FloorStructure
()
Item Index
Methods
Methods
add
-
propertyName
-
value
Returns:
addOneWall
-
a
-
b
-
options
Adds one wall to the floor. The wall will be merged with the existing walls of the floor if needed.
Parameters:
-
a
BABYLON.Vector2The first point, must have x and y attribute ( BABYLON.Vector2 for example ).
-
b
BABYLON.Vector2The second point, must have x and y attribute ( BABYLON.Vector2 for example ).
-
options
ObjectSet of options
Returns:
The added wall
addWallsAsPolygon
-
polygon
-
options
Adds walls to the floor. The walls will be merged together if needed, and with the existing walls of the floor if needed.
Parameters:
-
polygon
BABYLON.Vector2The 2D polygon, is an array of point objects which must have x and y attribute ( BABYLON.Vector2 for example ). The polygon does not need to repeat the first and last elements, it's already considered closed.
-
options
ObjectSet of options
Returns:
The added walls.
clone
()
FloorStructure
Clones the current floor structure.
Returns:
the cloned object
deserialize
-
hybrid
Parameters:
-
hybrid
ObjectJSON describing the object, built with the method serialize.
Returns:
dirty
()
Signals that the floor geometry has been dirtied, and needs to be updated.
disableCeiling
()
Disable the ceiling on all the floor
getElementByIdentifier
-
id
-
category
-
[identifier="id"]
Returns an indexed element in the given category.
getElementByName
-
name
-
collection
Parameters:
Returns:
getElements
-
category
Returns all elements in a category.
Parameters:
-
category
StringCategory of an element (ex: "walls", "points",...).
Returns:
List of elements of the category.
getFloor
-
collection
Parameters:
-
collection
StringCollection to search within.
Returns:
initialize
()
private
insertElement
-
category
-
element
Inserts an element into the structure.
Parameters:
-
category
StringCategory of the object (ex: "walls", "points",...).
-
element
BaseStructureElement to insert.
isDirty
()
Boolean
Checks if the floor geometry has been dirtied.
Returns:
The geometry status.
prepareWallStructure
-
a
-
b
-
options
Instanciates a WallStructure with the desired parameters
Parameters:
-
a
BABYLON.Vector2The first point, must have x and y attribute ( BABYLON.Vector2 for exemple ).
-
b
BABYLON.Vector2The second point, must have x and y attribute ( BABYLON.Vector2 for exemple ).
-
options
ObjectSet of options
Returns:
The wall structure
reindexElements
-
collection
-
start
Reindexes a collection.
removeAllWalls
()
Removes all the walls of the floor
removeElement
-
category
-
element
Deletes an element from a category in the structure.
Parameters:
-
category
StringCategory of the element (ex: "walls", "points",...).
-
element
BaseStructureElement to delete.
removeElements
-
category
-
elements
Replaces all the elements of a category.
Parameters:
-
category
StringCategory of the element (ex: "walls", "points",...).
-
elements
BaseStructure[]Array of elements to insert.
serialize
()
Object
Returns:
tidy
()
Signals that the floor geometry has been tidied, and no longer needs to be updated.
update
()
updateReferences
-
structure
Update the floor's walls' parents after deserialization.
Parameters:
-
structure
BaseStructuredeserialized FloorStructure
Properties
dirtyGeometry
Boolean
This flag signals if the geometry of the floor has been dirtied by some component.
Components should read this with isDirty()
and update their logic if the floor is dirty.
elevation
Number
Floor elevation. Represents the "y" coordinate of the bottom of the floor.
Default: 0
externalRooms
RoomStructure[]
Array of RoomStructure referenced in this floor. These rooms are external, see Wiki for more info.
extraPanes
WallPane3D[]
Extra wall panes, needed for the decoration of the house to be complete. Act as fillers.
height
Number
Floor height. Represents the height difference between the top (ceiling) and the bottom of the floor.
Default: 250
internalRooms
RoomStructure[]
Array of RoomStructure referenced in this floor. These rooms are internal, see Wiki for more info.
lockElevation
Boolean
Lock floor elevation. When true, prevents auto modification of this floor's elevation.
Default: false
objects
ObjectStrcture
Array of ObjectStructure referenced in this floor.
subSlopeOverture
SubSlopeOvertureStructure[]
Array of SubSlopeOvertureStructure referenced in this floor.