FloorStructure
Summary
Floor.
Constructor
FloorStructure
Syntax
FloorStructure
()
Summary
Item Index
Methods
Methods
add
Syntax
add
-
propertyName
-
value
Summary
Adds an element to the collection in parameter.Returns:
addOneWall
Syntax
Summary
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
Syntax
Summary
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.
deserialize
Syntax
Summary
Deserializes the object (from JSON).Parameters:
-
hybrid
ObjectJSON describing the object, built with the method serialize.
Returns:
dirty
Syntax
dirty
()
Summary
Signals that the floor geometry has been dirtied, and needs to be updated.
disableCeiling
Syntax
disableCeiling
()
Summary
Disable the ceiling on all the floor
getElementByIdentifier
Syntax
getElementByIdentifier
-
id
-
category
-
[identifier="id"]
Summary
Returns an indexed element in the given category.
getElementByName
Syntax
Summary
Gets an element of the collection by its name.Parameters:
Returns:
getElements
Syntax
Summary
Returns all elements in a category.
Parameters:
-
category
StringCategory of an element (ex: "walls", "points",...).
Returns:
List of elements of the category.
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 componentinsertElement
Syntax
insertElement
-
category
-
element
Summary
Inserts an element into the structure.
Parameters:
-
category
StringCategory of the object (ex: "walls", "points",...).
-
element
BaseStructureElement to insert.
isDirty
Syntax
Summary
Checks if the floor geometry has been dirtied.
Returns:
The geometry status.
prepareWallStructure
Syntax
Summary
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
Syntax
reindexElements
-
collection
-
start
Summary
Reindexes a collection.
removeAllWalls
Syntax
removeAllWalls
()
Summary
Removes all the walls of the floor
removeElement
Syntax
removeElement
-
category
-
element
Summary
Deletes an element from a category in the structure.
Parameters:
-
category
StringCategory of the element (ex: "walls", "points",...).
-
element
BaseStructureElement to delete.
removeElements
Syntax
removeElements
-
category
-
elements
Summary
Replaces all the elements of a category.
Parameters:
-
category
StringCategory of the element (ex: "walls", "points",...).
-
elements
BaseStructure[]Array of elements to insert.
serialize
Syntax
Summary
Serializes the object (to JSON)Returns:
tidy
Syntax
tidy
()
Summary
Signals that the floor geometry has been tidied, and no longer needs to be updated.
update
Syntax
update
()
Summary
Generic update method, must be overridden.updateReferences
Syntax
updateReferences
-
structure
Summary
Update the floor's walls' parents after deserialization.
Parameters:
-
structure
BaseStructuredeserialized FloorStructure
Properties
dirtyGeometry
Syntax
dirtyGeometry
Boolean
Summary
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
Syntax
elevation
Number
Summary
Floor elevation. Represents the "y" coordinate of the bottom of the floor.
Default: 0
externalRooms
Syntax
externalRooms
RoomStructure[]
Summary
Array of RoomStructure referenced in this floor. These rooms are external, see Wiki for more info.
extraPanes
Syntax
extraPanes
WallPane3D[]
Summary
Extra wall panes, needed for the decoration of the house to be complete. Act as fillers.
height
Syntax
height
Number
Summary
Floor height. Represents the height difference between the top (ceiling) and the bottom of the floor.
Default: 250
internalRooms
Syntax
internalRooms
RoomStructure[]
Summary
Array of RoomStructure referenced in this floor. These rooms are internal, see Wiki for more info.
lockElevation
Syntax
lockElevation
Boolean
Summary
Lock floor elevation. When true, prevents auto modification of this floor's elevation.
Default: false
objects
Syntax
objects
ObjectStrcture
Summary
Array of ObjectStructure referenced in this floor.
overtures
Syntax
overtures
OvertureStructure[]
Summary
Array of OvertureStructure referenced in this floor.
stairways
Syntax
stairways
StairwayStructure[]
Summary
Array of StairwayStructure referenced in this floor.
subSlopeOverture
Syntax
subSlopeOverture
SubSlopeOvertureStructure[]
Summary
Array of SubSlopeOvertureStructure referenced in this floor.
subslopes
Syntax
subslopes
SubSlopeStructure[]
Summary
Array of SubSlopeStructure referenced in this floor.