I'm trying to manually translate the transform of a second entity (with collider component) with a first entity and use the first entity in effect as a 'parent'. Both entities are root level. And in doing the manual calculation for syncing position and rotation, I need to get the Quaternion.Inverse(parent.rotation), but mathematics quaternion does not seem to have the "Inverse" function available. My thoughts in this direction is based on this approach with UnityEngine.Quaternion:
//calculate offsets
Vector3 offsetPos = child.position - parent.position;
Quaternion offsetRot = child.rotation * Quaternion.Inverse(parent.rotation);
offsetPos = Quaternion.Inverse(parent.rotation) * offsetPos;
//apply the relative transformation
child.position = parent.rotation * offsetPos + parent.position;
child.rotation = parent.rotation * offsetRot;
What is the equivalent of this with Unity.Mathematics.quaternion, or is there a more preferred way as it goes with DOTS?