Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Obi softbody catching on the edge of collider
#7
Hi,

You're using non-uniform scaling on the solver (scaling the X and Y axis, but not the Z axis ) and your colliders (which internally are converted to the solver's local space) are rotated. Non uniform scaling + rotation = shearing. So what's happening is that your colliders are getting distorted due to composing non-uniform scaling and rotation. From Unity's documentation:

https://docs.unity3d.com/Manual/class-Transform.html

Quote:Limitations with Non-Uniform Scaling

When a child object has a non-uniformly scaled parent and is rotated relative to that parent, it may appear skewed or “sheared”. There are components that support simple non-uniform scaling but don’t work correctly when skewed like this. For example, a skewed Box Collider
will not match the shape of the rendered mesh accurately
.

Also, see:
https://en.wikipedia.org/wiki/Shear_mapping
https://answers.unity.com/questions/9613...rmati.html


You can fix this by using uniform scale (scale the Z axis as well). Line 100 of your Hrac.cs script should be:

Code:
softbodySolver.transform.localScale = new Vector3(v3, v3, v3);

instead of

Code:
softbodySolver.transform.localScale = new Vector3(v3, v3, 1);
Reply


Messages In This Thread
RE: Obi softbody catching on the edge of collider - by josemendez - 03-06-2021, 01:04 PM