18-10-2017, 12:50 PM
(This post was last modified: 18-10-2017, 12:51 PM by josemendez.)
(16-10-2017, 07:10 PM)popuz Wrote: Dear Jose,
does it mean that it is good to use the FixedJoint for non-kinematic rigidbody drag? I mean, if i take classical included in Unity script "DragRigidbody.cs" and change the Joint to be Fixed instead of Spring Joint. And then I will have closed bottle (with 20 convex mesh-colliders) as non-kinematic rigidbody with obi-fluid inside. Then the fluid will be ok on drag and all water will remain inside bottle?
I ask it because FixedJoint is also similar to teleport as I can see....
Dear Jose,
I want to make simple chemistry game with bulbs, bottles, probes and ect. Which parametres and settings will you advise to me for more stable simulations, supposing all liquids will be just a water. And main mechanics will be the putting water form one bulb to another. I mean settings for Obi Solver, Emiiter and Collision Materials settings.
Hi!
I believe I answered this in a PM, but will post my answer here in case it can help someone else out:
The issue you refer to is quite a common one, that happens in all physics engines. It is known as "tunneling", and is usually dealt with by using "continuous collision detection", or CCD. Obi implements CCD by default, however all CCD algorithms need the velocity of all objects involved in a collision in order to be effective. In your case, changing the container position around is basically the same as teleporting it. It has zero velocity, thus CCD cannot kick in.
There's a sample scene included in Obi called "FaucetAndBucket". There you can see that fluid does not escape the bucket even though you can drag the bucket around quite fast.
This is done by adding a rigidbody to the bucket, and setting its velocity accordingly when dragging it (see the included ObjectDragger.cs script). This way continuous collision detection has a velocity value to work with, and as a result collision detection is much more precise and tunneling happens less often.
Still, at *very* high speeds collisions can be missed. For this reason you should limit the maximum speed at which users are allowed to drag the containers.