Skip to main content

Module particle_skin

Module particle_skin 

Source
Expand description

Skinning a particle cloud to a skeleton.

The engine can already build a skeleton, sample a clip into a Pose, mask it, blend it and solve IK onto it. What it could not do was move anything made of particles with the result: [SkinningMatrices] is built for GPU vertex skinning, and a body made of a hundred thousand loose points with a spring each is not a vertex buffer.

This is that bridge, and it is the piece that makes skeletal animation useful to a renderer whose primitive is the particle.

§Why it binds itself

A mesh arrives from a modelling tool with weights already painted on. A particle cloud does not: it is produced by code that stamps shapes into space and has no idea a skeleton exists. So the binding is derived — each particle is attached to the bone segments it is nearest to, with weights that fall off smoothly across a joint, so an elbow bends instead of shearing. Bind once, at build time; after that a pose costs two transforms and a lerp per particle.

§Where the result goes

Skinning produces the rest target, not the final position. Hand it to an crate::entity::AmorphousEntity’s formation and the cohesion springs chase it, which is what gives the motion its weight for free: heavy matter lags the bone it is bound to, light matter whips past and overshoots, and cloth trails a beat behind the body it hangs from. None of that has to be authored. It falls out of skinning to a spring system rather than to a vertex.

Structs§

Bind
One particle’s attachment to the skeleton.
ParticleSkin
A particle cloud’s attachment to a skeleton.

Constants§

MAX_INFLUENCES
How many bones may influence one particle.