Hi everyone,
Context
I have been working on this for two weeks or so now. Initially I just wanted to port a Ragdoll script to the new Havok engine. The biggest road block turned out to be the matching of rotations between physics colliders to bone TransformNodes of the skeleton (under a GLTF root node). This can be condensed down a bit further.
Almost embarrassingly to the very simple problem of copying a rotation of one mesh to another one.
Code
Anyway, the first playground1 passes. Line 66 has the main function. Goal is to copy red to green:
Up to the delta part is where I would say I understand sort of why I did that. Then, according to the docs, if you rotate in order of ZXY then this is like rotating local angles by YXZ. Since the delta angles are in World space, I have to use the ZXY order. Anyway, a pass is a pass so next.
It is basically the first playground but has the source rotated again. Fails. At first I thought I double rotate something. But I already only rotate by the delta angles!
There is just a single rotation but the parent node has a negative scaling. I know that negative scaling does some weird shit to rotations. Maybe there is some magic “offset” missing which would fix test2 and test3?
Well I am stuck now. I have two other completely different approaches (wildly applying offsets [got me the furthest actually, lol]; normalising with de-/re-parenting). But all fail at some point. I am out of ideas now
Best wishes
Joe