Expand description
Skeleton maths for GraphicsMesh bones.
Convention (verified against all eight skinned meshes, combining weighted geometry with rigid node geometry when comparing stored bounds):
- stored quaternions are conjugated relative to the column-vector convention used here;
- world = parent_world * local;
- skinning matrix = world * inverse_bind, where
inv_rotation/inv_translationis the inverse bind.
Skinned vertices are stored in a per-mesh frame; the bind-pose palette maps them to model space.
Structs§
- Transform
- A bone transform: a rotation and a translation.
Functions§
- bind_
palette - Palette for the bind pose.
- inverse_
bind - The inverse of a bone’s bind transform, for skinning.
- local_
bind - Bone-local bind transform.
- palette
- Skinning palette (world * inverse bind) for the given local pose.
- skin_
to_ static - Skin 32-byte
ModelSkinLayoutvertices (i16x4 position /512, i16x4 texcoords, unorm8x4 normal, 4 unused bytes, unorm8x4 weights, u8x4 bone indices) with a palette into the 24-byte staticModelLayout(position, texcoords, normal, zeroed user data). Used to draw characters in a fixed pose without GPU skinning. - world_
transforms - World transforms for the given local transforms (bones are stored parents-first).