ObjectStructure Class
Structure of an object.
Constructor
ObjectStructure
-
fileName
-
baseUrl
-
transforms
-
builderId
Item Index
Methods
Methods
add
-
propertyName
-
value
Returns:
animate
-
object
-
target
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
-
structure
Checks if the object structure contains errors, and if so removes it
Parameters:
-
structure
FloorStructureThe floorStructure to which the object belongs
clone
()
ObjectStructure
Clones the object, making a deep copy.
Returns:
A new instance of the object, with the same attributes.
deserialize
-
hybrid
Parameters:
-
hybrid
ObjectJSON describing the object, built with the method serialize.
Returns:
getAvailableProperties
()
Object
Get the available properties of the programmable instance.
NB : This is a shortcut to
Programmable.getAvailableProperties
.
Returns:
An object containing the programmable properties.
getElementByName
-
name
-
collection
Parameters:
Returns:
getFloor
-
collection
Parameters:
-
collection
StringCollection to search within.
Returns:
getMaterial
-
name
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
()
private
isPropertyLocked
-
key
Check if a property is locked or not, based on backoffice directives
Parameters:
-
key
Stringthe property key
Returns:
serialize
()
Object
Returns:
setMaterial
-
material
-
name
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
()
updateReferences
-
structure
Parameters:
-
structure
wnp.StructureFloor Structure to work with
Properties
baseUrl
String
The path to the programmable file, such as /js/Programmables/ . This supports http requests such as : http://github.com/wanadev/Programmables/
objectInstance
BABYLON.Mesh
A reference to the mesh.
position
BABYLON.Vector3
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
Number
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
Programmable
A reference to the programmable.
rotation
BABYLON.Vector3
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
BABYLON.Vector3
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.