ObjectStructure
Summary
Structure of an object.
Constructor
ObjectStructure
Syntax
ObjectStructure
-
fileName
-
baseUrl
-
transforms
-
builderId
Summary
Item Index
Methods
Methods
add
Syntax
add
-
propertyName
-
value
Summary
Adds an element to the collection in parameter.Returns:
animate
Syntax
animate
-
object
-
target
Summary
Animates an animatable object. Since objects can have multiple animations for their multiple meshes, pass the targeted mesh in parameter.
NB : This is a shortcut to
Programmable.animate
.
Parameters:
-
object
BABYLON.MeshThe mesh of the object.
-
target
BABYLON.MeshThe specific mesh which should be animated.
checkCoherence
Syntax
checkCoherence
-
structure
Summary
Checks if the object structure contains errors, and if so removes it
Parameters:
-
structure
FloorStructureThe floorStructure to which the object belongs
clone
Syntax
Summary
Clones the object, making a deep copy.
Returns:
A new instance of the object, with the same attributes.
deserialize
Syntax
Summary
Deserializes the object (from JSON).Parameters:
-
hybrid
ObjectJSON describing the object, built with the method serialize.
Returns:
getAvailableProperties
Syntax
Summary
Get the available properties of the programmable instance.
NB : This is a shortcut to
Programmable.getAvailableProperties
.
Returns:
An object containing the programmable properties.
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:
getMaterial
Syntax
getMaterial
-
name
Summary
Gets the material of a given mesh or child mesh.
Parameters:
-
name
StringThe mesh name, this mesh must be
objectStructure.objectInstance
or one of its children.
Returns:
The material.
initialize
Syntax
initialize
()
private
Summary
Method called after the loading of the componentisPropertyLocked
Syntax
Summary
Check if a property is locked or not, based on backoffice directives
Parameters:
-
key
Stringthe property key
Returns:
serialize
Syntax
Summary
Serializes the object (to JSON)Returns:
setMaterial
Syntax
setMaterial
-
material
-
name
Summary
Sets the material of a named mesh.
Parameters:
-
material
BABYLON.MaterialThe new Material.
-
name
StringThe mesh name, this mesh must be
objectStructure.objectInstance
or one of its children.
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
Properties
baseUrl
Syntax
baseUrl
String
Summary
The path to the programmable file, such as /js/Programmables/ . This supports http requests such as : http://github.com/wanadev/Programmables/
filename
Syntax
filename
String
Summary
The name of the programmable file, such as MyProgrammable.js
objectInstance
Syntax
objectInstance
BABYLON.Mesh
Summary
A reference to the mesh.
position
Syntax
position
BABYLON.Vector3
Summary
A reference to the mesh position.
/!\ This is a reference to this.objectInstance.position
and not a copy,
breaking the reference will result in hard failure in serialization.
preferredYAngle
Syntax
preferredYAngle
Number
Summary
Defines an optimal angle for the object. The object is well positioned when the angle between its x axis and a wall is equals to this value. This value is used by the magnetism algorithm to make the objects face the right direction. Angle must be k * Pi/2, else it will probably give unwanted result.
programmableInstance
Syntax
programmableInstance
Programmable
Summary
A reference to the programmable.
rotation
Syntax
rotation
BABYLON.Vector3
Summary
A reference to the mesh rotation.
/!\ This is a reference to this.objectInstance.rotation
and not a copy,
breaking the reference will result in hard failure in serialization.
scaling
Syntax
scaling
BABYLON.Vector3
Summary
A reference to the mesh scaling
/!\ This is a reference to this.objectInstance.scaling
and not a copy,
breaking the reference will result in hard failure in serialization.