PointStructure
Summary
Class representing wall points.
Constructor
PointStructure
Syntax
PointStructure
()
Summary
Item Index
Methods
Properties
Methods
add
Syntax
add
-
propertyName
-
value
Summary
Adds an element to the collection in parameter.Returns:
deserialize
Syntax
Summary
Deserializes the object (from JSON).Parameters:
-
hybrid
ObjectJSON describing the object, built with the method serialize.
Returns:
forceMerge
Syntax
forceMerge
-
point
-
fs
Summary
Forces merging with another point.
Parameters:
-
point
PointStructureOther point to merge with. It will be deleted from the floor structure.
-
fs
FloorStructureThe floor structure containing this point.
getElementByName
Syntax
Summary
Gets an element of the collection by its name.Parameters:
Returns:
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 componentisAttached
Syntax
Summary
Returns the current attached status.
Returns:
True if the point is attached.
remove
Syntax
remove
-
fs
Summary
Removes the point from the floor structure.
Parameters:
-
fs
FloorStructureThe floor structure referencing this point.
replaceParent
Syntax
replaceParent
-
oldWall
-
newWall
Summary
Replaces a parent wall with another parent wall.
NB: The order of the parents list can change.
Parameters:
-
oldWall
WallStructureThe old parent.
-
newWall
WallStructureThe new parent, can be undefined if you just want to delete a parent.
serialize
Syntax
Summary
Serializes the object (to JSON)Returns:
translate
Syntax
translate
-
vector
Summary
Moves the point by a given offset vector.
Parameters:
-
vector
BABYLON.Vector2Offset vector.
tryAttach
Syntax
Summary
Tries to attach the point to the surrounding walls, if possible.
Parameters:
-
fs
FloorStructureThe floor structure containing this point.
-
[blacklist]
WallStructure optionalWall to ignore while searching for candidates.
Returns:
False if nothing has been attached, true otherwise.
tryMerge
Syntax
Summary
Tries to merge the point with the other surrounding points, if possible.
Parameters:
-
fs
FloorStructureThe floor structure containing this point.
Returns:
The merged point. Returns this point if nothing has been merged.
unAttach
Syntax
Summary
Unattaches a point from a wall.
Returns:
False if the point wasn't previously attached, true otherwise.
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
wallAttached
Syntax
Summary
Returns the wall to which the point is attached.
Returns:
A wall, or undefined/null if the point is not attached.
Properties
attachedTo
Syntax
attachedTo
WallStructure
Summary
Wall to which the point is attached. Can be null.
needsUpdate
Syntax
needsUpdate
Boolean
Summary
Flag that indicates if the points needs to be updated (attached or merged).
parents
Syntax
parents
WallStructure[]
Summary
The parent walls of the point. The length can be 1 or 2.
position
Syntax
position
BABYLON.Vector2
Summary
2D position of the point.