pub struct Primitive {
pub material: Option<usize>,
pub indices: Vec<u32>,
pub positions: Vec<Vec3>,
pub normals: Vec<Vec3>,
pub uvs: Vec<[f32; 2]>,
pub joints: Vec<[u16; 4]>,
pub weights: Vec<[f32; 4]>,
}Expand description
One triangle-list primitive sharing a material. Attribute arrays may be
indexed already; Primitive::weld dedupes an unindexed primitive into
indexed form.
Fields§
§material: Option<usize>Index into SceneAssets::materials.
indices: Vec<u32>Triangle indices into the attribute arrays; empty = unindexed.
positions: Vec<Vec3>Vertex positions in scene units.
normals: Vec<Vec3>Same length as positions, or empty.
uvs: Vec<[f32; 2]>Same length as positions, or empty.
joints: Vec<[u16; 4]>Indices into the owning mesh’s skin_joints; empty if unskinned.
weights: Vec<[f32; 4]>Skinning weights parallel to Primitive::joints.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Primitive
impl RefUnwindSafe for Primitive
impl Send for Primitive
impl Sync for Primitive
impl Unpin for Primitive
impl UnsafeUnpin 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