03-06-2021, 01:04 PM
(This post was last modified: 03-06-2021, 01:12 PM by josemendez.)
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
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:
instead of
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);