Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Obi softbody catching on the edge of collider
#1
Hi,
when I roll over edge of collider, the softbody will glitch out.
Two box colliders that are close together, and one is at the angle.
Here is setup:
https://drive.google.com/file/d/16Zr0FPN...sp=sharing
https://drive.google.com/file/d/1TewA4SM...sp=sharing

I'll send you video in PM in a minute if that's okay.

I tried increase thickness, but changing Thickness parameter of Obi collider is not presented in scene view. Only original collider is visible. 

Thanks.
Reply
#2
(27-05-2021, 02:29 PM)richienko Wrote: I tried increase thickness, but changing Thickness parameter of Obi collider is not presented in scene view. Only original collider is visible. 

Thickness only affects the way Obi particles react to the collider. The "original" collider is not modified in any way (as it's part of Unity's physics engine). Quoting the manual:
http://obi.virtualmethodstudio.com/tutor...sions.html
Quote:Note that ObiCollider's thickness parameter is independent of Unity colliders' contactOffset. You can use both to independently adjust collisions with Obi actors and with other colliders.

Add a ObiParticleRenderer component to your softbody to visually debug particles and be able to tell what might be causing this. Box corners aren't treated differently than any other collider, so unless there's something off with your setup they should pose no problem.

let me know if you need further help.
Reply
#3
The problem is that I'm scaling Solver to make balloon look bigger and it's causing that bug. When scale is exactly 1,1,1 everything is ok.
Only slight scale (1.3,1.3,1.3) and it's happening all the time. 
I don't want to use Volume softbody as I'm developing for mobile platform.
Reply
#4
Do you have some advice?
Reply
#5
Hi,

I'm unable to reproduce this by changing the solver scale. This does not affect collider thickness in any way, it just performs simulation in a "bigger" coordinate space. Tried this in the ObstacleCourse sample scene, and collision against corners is buttery smooth no matter what scale values (or collider thickness value) is used.

Would it be possible for you to share your scene so that I can take a closer look? You can send it to support(at)virtualmethodstudio.com.

thanks!
Reply
#6
I'm changing scale of Solver in runtime and that's what causes issue. ( I did mention changing thickness in previous post, but that was only to see if it fixes the issue )

EDIT: sorry I misread your post (I see that you changed solver scale)

Scaled solver is causing issue only onedge or incline platforms in my scene. I will share it with you, no problem. Thanks a lot.
Reply
#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
#8
Thank you very much for your time Jose!
It did fix the issue Sonrisa

The reason I was scaling only x/y axis is because scaling Z axis also moves softbody backwards/forwards. Which is undesirable.
Reply
#9
Quote:Thank you very much for your time Jose!
It did fix the issue

You're welcome Sonrisa

(03-06-2021, 01:34 PM)richienko Wrote: The reason I was scaling only x/y axis is because scaling Z axis also moves softbody backwards/forwards. Which is undesirable.

I kinda suspected that must be reason why you used non-uniform scaling. Thing is since the solver is always at the start of the track, scaling it moves actors towards/away from it (towards if you scale down, away if you scale up).

Keep in mind that scaling the solver does not scale each individual actor in it (deformable objects can't be scaled in the general case). It scales the simulation space, which is slightly different.

You could either live with this if the scaling happens at a small enough pace and the tracks are short enough, or get a bit hacky and periodically move the solver towards the actor and keep the actor at the same spot.
Reply
#10
Thanks again. The plan is that I will have three ballons in same solver so they can interact with each other.
Will they collide together from three different solvers, but different phase?

If not, I guess the only path here is to solve this in shader Sonrisa
Reply