Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calculating the Amount of Fluid
#3
(04-03-2021, 03:57 PM)josemendez Wrote: You can use a trigger collider that spans the entire volume of the container. Then use collision callbacks:
http://obi.virtualmethodstudio.com/tutor...sions.html

To count how many particles there are inside the container. Check the included FluidMaze sample scene, it uses this method to calculate the percentage of fluid that has reached the maze goal.

As a side note, the FluidMaze sample scene only counts the particles that already reached the goal, regardless whether said particle is still inside the goal or not. Of course you can modify it a bit to make it run every single frame and that way you will have an always up to date amount, but it comes at the cost of performance.

But most likely you don't have to check it every single frame. You can pinpoint specifics points in you game when you need to do this and only do it then.
Reply


Messages In This Thread
Calculating the Amount of Fluid - by Oziko - 04-03-2021, 03:53 PM
RE: Calculating the Amount of Fluid - by Samadhi - 04-03-2021, 10:26 PM