Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ParticleCollisionEvent OnParticleCollision
#3
(29-01-2018, 05:06 PM)tooomg Wrote: If you want it to trigger only once per particle, you can store the list of the already-processed particles in a HashSet within the class handling the collision (or anywhere you see fit). For each collision, you would check if contact.particle is not present in the set and then proceed with your collision logic, and then add the contact.particle ID into the HashSet for it to not be proceed ever again Sonrisa

Cheers

Thx for your answer, its kind of working. The problem i have right now is, that maybe obi fluid is using some kind of object pooling, because my hashset is not getting new values at the size of 1414 everytime. Maybe thats the maxsize of particles in obifluid before it starts reusing old Particles. The problem is that i dont want to hardcode a clear of the hashset at 1414, because i don't really know where that number is coming from. Also performance is getting really bad, as the hashset grows..

Cheers
Reply


Messages In This Thread
RE: ParticleCollisionEvent OnParticleCollision - by UTFLuke - 30-01-2018, 09:29 AM