I've encountered a consistently reproducible bug that is so critical it renders ObiRope virtually unusable.
I have a scene:
Reproduction:
I have a scene:
- A scene with spherical rigidbodies with X, Y and Z rotations locked (which produces an inertia tensor of 0 along locked axes.)
- The spherical rigidbodies are manipulated via script.
- The spherical rigidbodies have an ObiRigidbody and ObiCollider attached initially.
- Initially, no ropes, cloth, or any other Obi objects (aside from the aforementioned) are present in the scene.
Reproduction:
- On a fresh unity start after closing it down completely, I run the scene.
- Initially everything works correctly.
- So long as I do not place a rope in the scene, I can stop and play the scene as many times as I like.
- I place the rope in the scene - which I do while playing; it isn't initially in the scene - it works correctly at first. I use a script to attach a rope to two surfaces selected by the player. Also worth nothing that no ObiSolvers are present in the scene until a rope is added.
- Then after stopping and starting a new play session - WITHOUT placing any ropes in the new play session - the spherical rigidbodies are given such extreme forces that they are often sent straight into NaN-land. It doesn't appear to matter where the ropes are attached in the previous session.
- Running a debugger and inspecting the values provided to ObiRigidbody.UpdateVelocities, they are often insane values with a magnitude greater than 1.0e+20, if not outright NaN.
- Even if I add a condition that the provided velocities are only added if their magnitudes are < 1000, the sphere rigidbodies will be accelerated with a huge amount of force along either the X, Y or Z axis in either direction.
- Removing the ObiRigidbody (and ObiCollider) components prevents this.
- The only way to bring ObiRigidbody into a usable state is to re-start the editor.