Obi Official Forum
Number of Fluid Particles in Container - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Fluid (https://obi.virtualmethodstudio.com/forum/forum-3.html)
+--- Thread: Number of Fluid Particles in Container (/thread-352.html)



Number of Fluid Particles in Container - shreypareek1991 - 09-02-2018

Hello

I am trying to do a pouring task wherein the user is required to collect water from a faucet in one cup, and transfer it to another.
The final score is determined by the number of particles that were poured from the first cup to the second.

So for instance -
  • Let us assume total particles are 1000.
  • The user collects about 800 (misses 200 in the beginning).
  • And finally pours 200 (600 fall on the ground) into the second cup.
  • So the final score is 200.
How can I keep track of these numbers?


RE: Number of Fluid Particles in Container - josemendez - 10-02-2018

(09-02-2018, 09:21 PM)shreypareek1991 Wrote: Hello

I am trying to do a pouring task wherein the user is required to collect water from a faucet in one cup, and transfer it to another.
The final score is determined by the number of particles that were poured from the first cup to the second.

So for instance -
  • Let us assume total particles are 1000.
  • The user collects about 800 (misses 200 in the beginning).
  • And finally pours 200 (600 fall on the ground) into the second cup.
  • So the final score is 200.
How can I keep track of these numbers?

Hi,

Just use collision callbacks and a trigger collider. Then count how many particles are inside the trigger during any given frame:

http://obi.virtualmethodstudio.com/tutorials/scriptingcollisions.html


RE: Number of Fluid Particles in Container - shreypareek1991 - 11-02-2018

(10-02-2018, 06:23 PM)josemendez Wrote: Hi,

Just use collision callbacks and a trigger collider. Then count how many particles are inside the trigger during any given frame:

http://obi.virtualmethodstudio.com/tutorials/scriptingcollisions.html

Thank you Jose.
That worked.