This functions does not appear to rotate my object. Should settings in the InertialTensor have something todo with this? Even still Y is at 0.4 with X and Z being at Infitie.
Maybe I am not executing it in the correct group?
[RequireMatchingQueriesForUpdate]
[UpdateInGroup(typeof(FixedStepSimulationSystemGroup))]
[UpdateBefore(typeof(PhysicsSystemGroup))]
Any help would be much appreciated.
Context:
I am trying to rotate my Entity in the direction of its LinearVelocity:
float dotProduct = math.dot(math.normalize(rigidBodyAspect.WorldFromBody.Forward().xz), math.normalize(rigidBodyAspect.LinearVelocity.xz));
float angleDiff = math.acos(dotProduct);
angleDiff = math.cross(rigidBodyAspect.WorldFromBody.Forward(), rigidBodyAspect.LinearVelocity).y < 0 ? -angleDiff : angleDiff;
Debug.Log(angleDiff);
rigidBodyAspect.WorldFromBody.RotateY(angleDiff) ;