Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Suggestion / Idea  Manipulating Particles Individually
#3
(06-04-2021, 07:07 AM)josemendez Wrote: Manipulating individual particles/contacts at runtime is an integral part of Obi. The former is done using the particle API, the latter done using collision callbacks.

The manual contains a scripting section that explains both:
http://obi.virtualmethodstudio.com/tutor...icles.html
http://obi.virtualmethodstudio.com/tutor...sions.html


This part completely depends on how you implement your custom logic. Obi exposes flat arrays of contiguous, blittable particle data, so cache utilization is optimal and multithreading straightforward. This is the same data accessed dozens of times per frame by the engine itself. There's no reason for it to be slow, if implemented properly. All examples in the documentation are single-threaded for the sake of simplicity.


While particles are in contact with a trigger collider, Obi will report contacts between them every frame. You just need to identify which contacts involve the trigger, then set the velocity of the corresponding particle.

Let me know if you need help with this. cheers!

Edit: I just added some sample code to the collision callbacks page, showing how to change particle velocities while they're inside a trigger. Sonrisa
Reply


Messages In This Thread
RE: Manipulating Particles Individually - by ProudRoach - 08-08-2021, 11:32 PM