Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Callback for particle-particle collision
#2
(26-01-2018, 10:44 PM)tooomg Wrote: Hi there!

I'm looking for a way to know when particles from different phases are colliding, in order to do some custom logic for each collision. The collision physics itself is working so I guess there's nothing wrong with my setup, but it might be the case, I'm fairly new with Obi Fluid.
I've looked into the ObiSolver.OnCollision callback, but it seems that it only provides data for the collisions against the Colliders of my scene!
Is there a way of achieving this particle-against-particle detection? Maybe directly through the Oni API? I don't know if that's realistically feasible in terms of performance, but let's try hehehe


Cheers and thanks for this great plugin!
Tom

Hi Tom!

Unfortunately it is not possible to get particle-particle collision callbacks right now, basically because of how fluids work particles never actually collide between them. Each particle has a neighborhood and it applies position corrections to all particles within this radius using a support function known as "kernel" in fluid simulation jargon, that acts as a decay function to apply less intense corrections to particles further away from the one at the center of the kernel.

We might expose the list of per-particle neighbors for each particle on future versions. However due to the sheer amount of operations needed per particle, applying custom logic to this list in C# might prove unpractical due to low performance.
Reply


Messages In This Thread
RE: Callback for particle-particle collision - by josemendez - 29-01-2018, 10:11 AM