Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fluid Counter
#1
Hi Sonrisa

i am trying to find out the number of particles of water passing through a collider. 

Emitter produces 400 particulate water. Even if the collider touches all of them, the count remains around 200. 

http://obi.virtualmethodstudio.com/manua...sions.html   I looked here but I don't understand Triste 

https://imgur.com/a/if0G3bu
PHP Code:
   ObiSolver solver;
     [SerializeFieldint counter 0;

     void Awake()
     {
         solver GetComponent<ObiSolver>();
     }

     void OnEnable()
     {
         solver.OnCollision += Solver_OnCollision;
     }

     void OnDisable()
     {
         solver.OnCollision -= Solver_OnCollision;
     }

     void Solver_OnCollision(object senderObi.ObiSolver.ObiCollisionEventArgs e)
     {
         var world ObiColliderWorld.GetInstance();

         // just iterate over all contacts in the current frame:
         foreach (Oni.Contact contact in e.contacts)
         {
             // if this one is an actual collision:
             if (contact.distance 0.01)
             {
                 ObiColliderBase col world.colliderHandles[contact.bodyB].owner;
                 if (col != null && col.gameObject.layer == 7)
                 {
                     // do something with the collider.
                     counter=solver.contactCount;

                 }
             }
         }

     
Reply


Messages In This Thread
Fluid Counter - by 0hsyn1 - 05-09-2022, 01:04 PM
RE: Fluid Counter - by josemendez - 05-09-2022, 01:40 PM
RE: Fluid Counter - by 0hsyn1 - 05-09-2022, 01:49 PM
RE: Fluid Counter - by josemendez - 05-09-2022, 01:51 PM
RE: Fluid Counter - by 0hsyn1 - 05-09-2022, 01:58 PM
RE: Fluid Counter - by josemendez - 05-09-2022, 02:06 PM
RE: Fluid Counter - by 0hsyn1 - 05-09-2022, 02:10 PM