Obi Official Forum
Help Off-center collider issue - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html)
+--- Thread: Help Off-center collider issue (/thread-2063.html)



Off-center collider issue - Elastic Sea - 23-02-2020

I have a game where I connect groups of blocks with ropes, each group is a rigidbody and each block in the group is a collider.

When the blocks collider or the block itself is a little bit off-center (even though their center of mass is in the same place) they start to move erratically and rotate a lot. I don't know how to mitigate the issue.

Quick gif demonstrating the issue here: https://imgur.com/a/CEfeyNY

I have also created a small sample project with the issue here: https://drive.google.com/file/d/1O44VJ7vlB4BqrauML88P6n-U_1OJI4W7/view?usp=sharing

Thanks a lot.


RE: Off-center collider issue - josemendez - 24-02-2020

(23-02-2020, 03:07 AM)Elastic Sea Wrote: I have a game where I connect groups of blocks with ropes, each group is a rigidbody and each block in the group is a collider.

When the blocks collider or the block itself is a little bit off-center (even though their center of mass is in the same place) they start to move erratically and rotate a lot. I don't know how to mitigate the issue.

Quick gif demonstrating the issue here: https://imgur.com/a/CEfeyNY

I have also created a small sample project with the issue here: https://drive.google.com/file/d/1O44VJ7vlB4BqrauML88P6n-U_1OJI4W7/view?usp=sharing

Thanks a lot.

Hi!

Thanks for reporting this! There seems to be a bug in the application of inertia tensor rotation. For the time being, there's an easy fix that while no 100% accurate, results in acceptable dynamics in most cases. In Oni.cs, change line 245:

Code:
inertiaTensor = kinematic ? Vector3.zero : source.inertiaTensorRotation * invTensor;

to

Code:
inertiaTensor = kinematic ? Vector3.zero :  invTensor;

that should fix it. A proper fix will be added in the next update.


RE: Off-center collider issue - Elastic Sea - 25-02-2020

It works much better, thank you.