Distance calculations for particle systems

Post Reply
r.khlebnikov
Posts: 1
Joined: Mon Oct 04, 2010 7:02 pm

Distance calculations for particle systems

Post by r.khlebnikov »

Hello everyone,

right now I'm experimenting with a new method for calculating a procedural flow field. The overall thing works pretty well, but I was wondering if I can improve performance by using Bullet Physics.
In order to calculate the 'wind' speed at a certain point in space I need to know the distance from this point to all dynamic and static rigid bodies in scene. The wind force is then used to calculate the forces affecting a 'snowflake' particle, which reacts to wind in a bit more complicated way than just a simple particle with mass. This distance calculation takes up to 80% of total computation time (even on very simple scenes). So, I am wondering if there is a way to make use of Bullet's parallelism and optimized algorithms (like broad phase stuff) to speed up this process?

Here's the problem description that might help:
Given:
- particle system (~100K particles)
- custom force field on particles
Task:
- for every particle - determine the distance to rigid bodies (static and dynamic). There is a cutoff distance (preferrably, rigid-object size dependant) - approx. 5% of body dimensions, beyond which the particles are not affected by this rigid body.

So, does anyone have any ideas on implementing this with physX or maybe other recommendation, like looking at some other library?

Thank you in advance,
Rostislav.
Post Reply