I start with a working example: If you want to let your player run around, you probably loop a run animation in-place and update player’s location elsewhere. In Babylon I operate on a parent TransformNode to do transforms like that. Works like a charm.
Now say, in a cinematic, you want to show your player doing a dramatic 180°-turn. Just setting the rotation or animating the rotation vector is not enough. You need fine-grained skeletal movements in order to make it look nice.
However, once you play the animation, the parent TransformNode is unaware of any changes resulting from playing animations. Differently put, the user sees the player character looking in this direction (Model/skeleton) whereas e.g. the VisibilityController shoots its rays in the opposite direction (TransformNode.rotation).
One solution I can imagine would be to update the rotation without actually rotating. I tried “freezeWorldMatrix”. It works initially but catches up after “Unfreeze”. I tried node._rotation but behaves like node.rotaiton. So, is it possible in any way?
Before you apply this rotation on the root-mesh, you have to apply both, root-mesh and -bone, rotations on Armature/Rig (inbetween root-mesh and root-bone), while bone rotation needs to be inverted. Then i guess it will work to apply rotation on root-mesh.
Example PG:
If rotation is only applied on a known bone it sure is faster to use node or bone directly:
scene.getNodeByName("Root").rotationQuaternion
or cone.skeleton.bones.find(bone => bone.name === "Root").rotationQuaternion