I'm trying to simulate the chemical experiment which required fluid pouring, mixing between bottles.
I simply pour the fluid from a bottle to another, some fluid flies off, and if I move the bottle quickly, all the fluid goes out of the bottle and disappear.
I'm trying to simulate the chemical experiment which required fluid pouring, mixing between bottles.
I simply pour the fluid from a bottle to another, some fluid flies off, and if I move the bottle quickly, all the fluid goes out of the bottle and disappear.
The attached script "ObiKinematicVelocities" and the parameter "Fixed Timestep" did help a little, but still the fluid fly off when moving the bottle.
Really need some hint, please kindly help, PM the project link to you.
Many many many thanks,
Albert
Make sure you're not using a MeshCollider for the container, as MeshColliders are hollow (which means they're made of paper-thin triangles, and have no concept of inside/outside).
(22-09-2020, 01:58 PM)josemendez Wrote: Make sure you're not using a MeshCollider for the container, as MeshColliders are hollow (which means they're made of paper-thin triangles, and have no concept of inside/outside).
Particles should not rotate or move, unless:
- The container's scale is non-uniform. Distance fields only support uniform scaling, as described in the docs.
- Collision constraint iteration count is very low.
Also, a thickness of 0.1 in your collider might be a bit too much. If you need a thicker container to prevent tunneling, use a second, different mesh to derive the distance field from, instead of using the same mesh used for rendering.
28-09-2020, 03:36 PM (This post was last modified: 28-09-2020, 03:37 PM by josemendez.)
(28-09-2020, 03:06 PM)gontz Wrote: [...] however you move it?
Not possible, not in Obi, not in any physics engine. There's always a movement speed beyond which tunneling will take place. It's built in the digital nature of computers and the way they represent time. Best you can do is try to prevent it in as many cases as possible, but it will never go away completely.
Best practices to avoid tunneling:
- Use the ObiKinematicVelocities component to help CCD.
- Use distance fields or primitive colliders instead of MeshColliders, as they're more robust to tunneling.
- The thicker your container's walls are, the better.
- Limit user interaction speed below tunneling speed.
- If all else fails, reduce your simulation timestep.
I modified the ObiKinematicVelocities script to update rigidbody velocities always in sync with the particle solver. This allows robust CCD even at very high speeds.
Replace your ObiKinematicVelocities.cs file with this one. Also make sure to give it a reference to the solver in your scene.