What does the mesh parameter do on bone methods?

Hi there,
Many bone class methods take an optional mesh parameter. For example getRotationQuaternion.
According to the documentation, this optional parameter is only used when setting the Space parameter to World.
Can someone explain what this mesh parameter is for? I can see that it does make a difference, for example The result of bone.getRotationQuaternion in world space changes when supplying a mesh, but I am unsure as to why…
How does supplying a mesh change a bone’s returned world rotation? Surely this never changes?
Obviously I’m wrong, but I’d really appreciate someone explaining why.

Thanks

This mesh parameter is simply used to take into account the mesh transformation before returning the bone transformation, so that if the mesh the bone is attached to is translated/rotated, the final bone matrix is transformed accordingly.

For eg, if the bone local transformation is only a translation (0,by,0) from its parent bone but the mesh it is attached to has a translation (tx,ty,tz), both translations should be added before being returned.

1 Like