View attach sample source code.
Demonstrates how to attach an object to an animated skeleton’s joint. This feature allows for example to render a sword in the hand of a character. This could also be used to attach an animated skeleton to an joint of an other animated one.
Initializing WebGL
The idea is to get the joint matix from the model-space matrices array (for the selected “hand” joint), and use this matrix to build transformation matrix of the attached object (the “sword”). Model-space matrices are ouputed by LocalToModelJob. An offset (from the joint) can be applied to the joint transformation by concatenating an offset matrix to joint matrix.
Some parameters can be tuned from sample UI to move the attached object from a join to an other, or change the offset from that joint: