You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have observed that the Rapier.js physics simulation loses determinism when using the collider.setRotationWrtParent and rigidBody.setRotation methods. Specifically, even when starting from the same initial state (restored via World.restoreSnapshot), the simulation outcomes differ every time these methods are applied. This behavior does not occur when only restoring the world snapshot without applying these methods.
constcollider=world.colliders.get(colliderHandle);collider.setRotationWrtParent(0);// also breaks determinism, even when the collider is already attached to a rigid body. This behavior contradicts the documentation, which states: "Does nothing if this collider isn't attached to a rigid-body." However, based on my observations, the method appears to have an effect even when the collider is attached, potentially introducing non-deterministic behavior.
Run the simulation multiple times and observe that the results differ each time.
Expected Behavior
The simulation should produce identical results every time it is run from the same initial state, regardless of whether collider.setRotationWrtParent or rigidBody.setRotation is used.
Actual Behavior
When collider.setRotationWrtParent or rigidBody.setRotation is called, the simulation outcomes vary between runs, breaking determinism.
It seems that these methods might introduce non-deterministic behavior due to floating-point precision issues or internal state changes that are not synchronized properly. This could be related to how the physics engine handles rotations internally.
The text was updated successfully, but these errors were encountered:
I have observed that the Rapier.js physics simulation loses determinism when using the
collider.setRotationWrtParent
andrigidBody.setRotation
methods. Specifically, even when starting from the same initial state (restored via World.restoreSnapshot), the simulation outcomes differ every time these methods are applied. This behavior does not occur when only restoring the world snapshot without applying these methods.Steps to Reproduce
Expected Behavior
The simulation should produce identical results every time it is run from the same initial state, regardless of whether
collider.setRotationWrtParent
orrigidBody.setRotation
is used.Actual Behavior
When
collider.setRotationWrtParent
orrigidBody.setRotation
is called, the simulation outcomes vary between runs, breaking determinism.Environment
@dimforge/rapier2d-compat
0.14.0
Additional Notes
It seems that these methods might introduce non-deterministic behavior due to floating-point precision issues or internal state changes that are not synchronized properly. This could be related to how the physics engine handles rotations internally.
The text was updated successfully, but these errors were encountered: