#[repr(C)]pub struct SkinnedVertex {
pub pos: [f32; 3],
pub normal: [f32; 3],
pub tangent: [f32; 3],
pub color: [f32; 3],
pub uv: [f32; 2],
pub joints: [u16; 4],
pub weights: [f32; 4],
}Expand description
Vertex layout for skeletally animated meshes. A superset of Vertex: the
same 56-byte static attributes plus four joint indices and four blend
weights. repr(C), 80 bytes, so it casts directly to a GPU buffer.
The vertex shader skins pos / normal / tangent by blending up to four
joint matrices: sum(weights[k] * joint[joints[k]] * v). Weights that sum
to less than 1 leave the remainder un-skinned; the build step normalises
them so this never happens for authored meshes.
Fields§
§pos: [f32; 3]Object-space position.
normal: [f32; 3]Unit-length normal.
tangent: [f32; 3]Object-space tangent, the normal map’s U direction.
color: [f32; 3]Linear RGB colour.
uv: [f32; 2]Texture coordinates.
joints: [u16; 4]Indices into the skeleton’s joint array, one per blend weight.
weights: [f32; 4]Blend weights, parallel to joints. Normalised at build time.
Trait Implementations§
Source§impl Clone for SkinnedVertex
impl Clone for SkinnedVertex
Source§fn clone(&self) -> SkinnedVertex
fn clone(&self) -> SkinnedVertex
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SkinnedVertex
Source§impl Debug for SkinnedVertex
impl Debug for SkinnedVertex
impl NoUninit for SkinnedVertex
Source§impl PartialEq for SkinnedVertex
impl PartialEq for SkinnedVertex
impl StructuralPartialEq for SkinnedVertex
Auto Trait Implementations§
impl Freeze for SkinnedVertex
impl RefUnwindSafe for SkinnedVertex
impl Send for SkinnedVertex
impl Sync for SkinnedVertex
impl Unpin for SkinnedVertex
impl UnsafeUnpin for SkinnedVertex
impl UnwindSafe for SkinnedVertex
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