Struct three_d_asset::Primitive
source · pub struct Primitive {
pub name: String,
pub transformation: Mat4,
pub animations: Vec<KeyFrameAnimation>,
pub geometry: Geometry,
pub material_index: Option<usize>,
}Expand description
Fields§
§name: StringThe name. Might not be anything meaningful.
transformation: Mat4A transformation that should be applied to the Primitive::geometry.
animations: Vec<KeyFrameAnimation>Optional animation applied to the Primitive::geometry. A transformation should be computed for a specific time and then multiplied together with Node::transformation.
geometry: GeometryThe geometry of this primitive.
material_index: Option<usize>Optional index into Model::materials, indicating which material should be applied to Primitive::geometry.
Methods from Deref<Target = Geometry>§
sourcepub fn compute_normals(&mut self)
pub fn compute_normals(&mut self)
Computes normals if it is relevant for the geometry.
sourcepub fn compute_tangents(&mut self)
pub fn compute_tangents(&mut self)
Computes tangents if it is relevant for the geometry.
sourcepub fn compute_aabb(&mut self) -> AxisAlignedBoundingBox
pub fn compute_aabb(&mut self) -> AxisAlignedBoundingBox
Computes the AxisAlignedBoundingBox for this geometry.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Primitive
impl<'de> Deserialize<'de> for Primitive
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for Primitive
impl Send for Primitive
impl Sync for Primitive
impl Unpin for Primitive
impl UnwindSafe for Primitive
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more