Hey there,
I am tinkering with teleporting objects while applying forces to them (my use case is recentering the physics scene when the objects are far from the origin so I avoid the 32bit imprecision of Havok calculations)
I think there is a bunch of stuff I don’t really understand as shown in this PG:
Basically, the cube is moving through space and I will teleport it back to the origin when it gets too far.
The issue happens on the frame where the teleportation happens: the object position changes suddenly and I need disablePreStep=false to make sure Havok acknowledges the change.
Using “Option 2”, I then apply my forces (thrust and gravity) on the object at its new position (here, teleported to the origin) but the object starts spinning. This makes me believe havok applies the force far from the object center, hence creating the rotation. I don’t understand why this happen since I updated the position of the object and used disablePreStep=false
What puzzles me even more is the fact “Option 1” does not have the same problem: we apply the force on the outdated object position (not teleported), then we teleport the object (and I expect Havok to work with the teleported position with disablePreStep=false). This should create a sync issue and some angular momentum, but instead everything seems to be working fine.
I am ok with using Option 1 since it works, but I would really like to understand why this is happening at all ![]()