PointStructure Class
Class representing wall points.
Constructor
PointStructure
()
Item Index
Methods
Properties
Methods
add
-
propertyName
-
value
Returns:
deserialize
-
hybrid
Parameters:
-
hybrid
ObjectJSON describing the object, built with the method serialize.
Returns:
forceMerge
-
point
-
fs
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
-
name
-
collection
Parameters:
Returns:
getFloor
-
collection
Parameters:
-
collection
StringCollection to search within.
Returns:
initialize
()
private
isAttached
()
Boolean
Returns the current attached status.
Returns:
True if the point is attached.
remove
-
fs
Removes the point from the floor structure.
Parameters:
-
fs
FloorStructureThe floor structure referencing this point.
replaceParent
-
oldWall
-
newWall
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
()
Object
Returns:
translate
-
vector
Moves the point by a given offset vector.
Parameters:
-
vector
BABYLON.Vector2Offset vector.
tryAttach
-
fs
-
[blacklist]
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
-
fs
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
()
Boolean
Unattaches a point from a wall.
Returns:
False if the point wasn't previously attached, true otherwise.
update
()
updateReferences
-
structure
Parameters:
-
structure
wnp.StructureFloor Structure to work with
wallAttached
()
WallStructure
Returns the wall to which the point is attached.
Returns:
A wall, or undefined/null if the point is not attached.
Properties
position
BABYLON.Vector2
2D position of the point.