Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Fluid passing through Containers
#1
Exclamación 
I have a tap that fills the container on tapping screen by changing emitting speed. After the container fills, it moves to a position. But during that movement the water inside the glass(container) fall through the glass. If anybody could help me that would be great. Plus I also want to increase the amount of water that should flow through the tap. I tried increasing the radius of particle renderer but it doesn't look so great. So any tips on that would also be very helpful. Thanks.
Reply
#2
(07-10-2019, 12:33 PM)Sany02 Wrote: I have a tap that fills the container on tapping screen by changing emitting speed. After the container fills, it moves to a position. But during that movement the water inside the glass(container) fall through the glass. If anybody could help me that would be great. Plus I also want to increase the amount of water that should flow through the tap. I tried increasing the radius of particle renderer but it doesn't look so great. So any tips on that would also be very helpful. Thanks.

Hi,

This issue commonly referred to as tunneling, exists in all physics engines and is inherent to how time is represented in computers as a discrete quantity, instead of a continuous one. Basically every time you move an object by changing its transform's position, you're actually "teleporting" it around. It its walls are thin enough compared to the size of your particles and to the amount of space it has teleported in a frame, you will leave particles outside of it because the container walls simply disappeared and reappeared in a completely different position the next frame.

Obi performs continuous collision detection (CCD) to alleviate this, but will only work if it can work out a speed for your container. Either add a ObiKinematicVelocities to it, or use forces to move it around instead of directly setting its position.

To increase the amount of water flowing from an emitter, increase its "speed" parameter. It controls both the amount of liquid as well as its velocity, just like a real-world faucet.
Reply
#3
(07-10-2019, 01:32 PM)josemendez Wrote: Hi,

This issue commonly referred to as tunneling, exists in all physics engines and is inherent to how time is represented in computers as a discrete quantity, instead of a continuous one. Basically every time you move an object by changing its transform's position, you're actually "teleporting" it around. It its walls are thin enough compared to the size of your particles and to the amount of space it has teleported in a frame, you will leave particles outside of it because the container walls simply disappeared and reappeared in a completely different position the next frame.

Obi performs continuous collision detection (CCD) to alleviate this, but will only work if it can work out a speed for your container. Either add a ObiKinematicVelocities to it, or use forces to move it around instead of directly setting its position.

To increase the amount of water flowing from an emitter, increase its "speed" parameter. It controls both the amount of liquid as well as its velocity, just like a real-world faucet.

Thank you for your reply. I tried what you suggested. The ObiKinemeticVelocities component was attatched to the glass but I was moving it through transform.Translate() now i'm moving it through rigidbody.velocity and it is working great. The only problem that I'm unable to solve right now is when the container is filled I want to make the water inside the container still and cancel all the forces inside the container. I tried killing them and that is not what I want. I also tried emitter.velocities[index] and angular velocities and set them to vector3.zero in collisions but couldn't succeed. In short I want to show the water but do not want it to simulate when the glass is filled. Thanks for helping out. 
Reply
#4
(08-10-2019, 06:18 AM)Sany02 Wrote: Thank you for your reply. I tried what you suggested. The ObiKinemeticVelocities component was attatched to the glass but I was moving it through transform.Translate() now i'm moving it through rigidbody.velocity and it is working great. The only problem that I'm unable to solve right now is when the container is filled I want to make the water inside the container still and cancel all the forces inside the container. I tried killing them and that is not what I want. I also tried emitter.velocities[index] and angular velocities and set them to vector3.zero in collisions but couldn't succeed. In short I want to show the water but do not want it to simulate when the glass is filled. Thanks for helping out. 

Hi,

In a nutshell what you want is control over inertial forces. So you need to perform your simulation in the container's local space, instead of world space. See:
http://obi.virtualmethodstudio.com/tutor...space.html
Reply