Struct dae_parser::Instance
source · [−]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
sourceimpl 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.
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for Instance<T> where
T: RefUnwindSafe,
<T as Instantiate>::Data: RefUnwindSafe,
impl<T> Send for Instance<T> where
T: Send,
<T as Instantiate>::Data: Send,
impl<T> Sync for Instance<T> where
T: Sync,
<T as Instantiate>::Data: Sync,
impl<T> Unpin for Instance<T> where
T: Unpin,
<T as Instantiate>::Data: Unpin,
impl<T> UnwindSafe for Instance<T> where
T: UnwindSafe,
<T as Instantiate>::Data: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more