pub struct CpuMesh {
pub primitive_id: PrimitiveId,
pub node_id: NodeId,
pub material_id: Option<MaterialId>,
pub positions: Vec<[f32; 3]>,
pub normals: Vec<[f32; 3]>,
pub tangents: Vec<[f32; 4]>,
pub indices: Vec<u32>,
pub texcoord_sets: Vec<Vec<[f32; 2]>>,
pub colors: Vec<[f32; 4]>,
pub topology: PrimitiveTopology,
}Expand description
A single primitive with every CPU-side transform already applied: morph weights accumulated, skinned primitives deformed by their joint matrices and non-skinned ones placed by their node’s world transform.
A renderer can upload these buffers directly without a morph or skinning shader. For valid assets, the result follows the same morphing and skinning semantics as the corresponding GPU path.
Fields§
§primitive_id: PrimitiveIdStable identifier of the source primitive.
node_id: NodeIdTyped identifier of the source node.
material_id: Option<MaterialId>Material selected by the source primitive.
positions: Vec<[f32; 3]>Final vertex positions (world space).
normals: Vec<[f32; 3]>Final normals, normalized after transformation.
tangents: Vec<[f32; 4]>Final tangents (xyz normalized, w handedness preserved).
indices: Vec<u32>Triangle/line/point indices into the vertex attributes.
texcoord_sets: Vec<Vec<[f32; 2]>>Consecutive TEXCOORD_n buffers.
colors: Vec<[f32; 4]>Vertex colors (RGBA).
topology: PrimitiveTopologyDraw topology.