pub struct CpuMesh {
pub vertices: Vec<CpuVertex>,
pub indices_u32: Vec<u32>,
pub joints0: Option<Vec<[u16; 4]>>,
pub weights0: Option<Vec<[f32; 4]>>,
pub primitive_topology: PrimitiveTopology,
pub index_format: IndexFormat,
}Expand description
CPU-side mesh data.
Contract:
vertices+indicesfully define geometry.primitive_topologyis how indices are interpreted.- Upload step will pack
verticesas tightly as possible into a GPU vertex buffer, andindicesinto a GPU index buffer.
Fields§
§vertices: Vec<CpuVertex>§indices_u32: Vec<u32>§joints0: Option<Vec<[u16; 4]>>Optional skinning data (glTF: JOINTS_0 / WEIGHTS_0).
Contract (when present):
len == vertices.len()joints0[i]corresponds toweights0[i]
weights0: Option<Vec<[f32; 4]>>§primitive_topology: PrimitiveTopology§index_format: IndexFormatImplementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CpuMesh
impl RefUnwindSafe for CpuMesh
impl Send for CpuMesh
impl Sync for CpuMesh
impl Unpin for CpuMesh
impl UnsafeUnpin for CpuMesh
impl UnwindSafe for CpuMesh
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.