ReferenceProperty
A Property which transparently links to another property on a provided object.
const collection = new EntityCollection();
//Create a new entity and assign a billboard scale.
const object1 = new Entity({id:'object1'});
object1.billboard = new BillboardGraphics();
object1.billboard.scale = new ConstantProperty(2.0);
collection.add(object1);
//Create a second entity and reference the scale from the first one.
const object2 = new Entity({id:'object2'});
object2.model = new ModelGraphics();
object2.model.scale = new ReferenceProperty(collection, 'object1', ['billboard', 'scale']);
collection.add(object2);
//Create a third object, but use the fromString helper function.
const object3 = new Entity({id:'object3'});
object3.billboard = new BillboardGraphics();
object3.billboard.scale = ReferenceProperty.fromString(collection, 'object1#billboard.scale');
collection.add(object3);
//You can refer to an entity with a # or . in id and property names by escaping them.
const object4 = new Entity({id:'#object.4'});
object4.billboard = new BillboardGraphics();
object4.billboard.scale = new ConstantProperty(2.0);
collection.add(object4);
const object5 = new Entity({id:'object5'});
object5.billboard = new BillboardGraphics();
object5.billboard.scale = ReferenceProperty.fromString(collection, '\\#object\\.4#billboard.scale');
collection.add(object5);
See also
Constructors
Properties
Gets the event that is raised whenever the definition of this property changes. The definition is changed whenever the referenced property's definition is changed.
Gets a value indicating if this property is constant.
Gets the reference frame that the position is defined in. This property is only valid if the referenced property is a PositionProperty.
Gets the resolved instance of the underlying referenced property.
The entity collection which will be used to resolve the reference.
The names of the property on the target entity which we will use.
Functions
Gets the Material type at the provided time. This method is only valid if the property being referenced is a MaterialProperty.
Gets the value of the property at the provided time.
Gets the value of the property at the provided time and in the provided reference frame. This method is only valid if the property being referenced is a PositionProperty.