pub struct Instance<T: Instantiate> {
pub sid: Option<String>,
pub url: UrlRef<T>,
pub name: Option<String>,
pub data: T::Data,
pub extra: Vec<Extra>,
}
Expand description
Instantiates a COLLADA material resource, possibly applying transformations or effects to the object.
The data
field depends on the type of object being instantiated.
Most types use ()
for this field but some types have additional data:
Instance<
Geometry
>:InstanceGeometryData
Instance<
Controller
>:InstanceControllerData
Instance<
Effect
>:InstanceEffectData
Instance<
PhysicsModel
>:InstancePhysicsModelData
Additionally, some instance nodes are even more different and have their own types:
InstanceMaterial
, notInstance<
Material
>
InstanceRigidBody
, notInstance<
RigidBody
>
InstanceRigidConstraint
, notInstance<
RigidConstraint
>
Fields§
§sid: Option<String>
A text string containing the scoped identifier of this element. This value must be unique within the scope of the parent element.
url: UrlRef<T>
The URL of the location of the T
element to instantiate.
Can refer to a local instance or external reference.
name: Option<String>
The text string name of this element.
data: T::Data
The additional data associated with the instantiation, if any.
extra: Vec<Extra>
Provides arbitrary additional information about this element.
Implementations§
Source§impl Instance<Geometry>
impl Instance<Geometry>
Sourcepub fn instance_materials(&self) -> &[InstanceMaterial]
pub fn instance_materials(&self) -> &[InstanceMaterial]
Get the list of InstanceMaterial
s bound in this Instance<Geometry>
.
Sourcepub fn get_instance_material(&self, symbol: &str) -> Option<&InstanceMaterial>
pub fn get_instance_material(&self, symbol: &str) -> Option<&InstanceMaterial>
Look up an InstanceMaterial
by symbol name.