Sign in to follow this  
Mystery

Particle collision detection and handling

Recommended Posts

I am currently doing some sort of particle system modeling. Is there a easy way to detect collision between particles? One inefficient way I can think of it the check the new position of the particle against all other particles in the system. Problem is that I have a more than ten thousand particles in the system. Also how do you resolve such collision? I am thinking of displacing the particle that got "hit" but this may lead to a chain reaction as the new displacement might result in another collision. Hope what I said makes some sense to you guys. :) Thanks for reading.

Share this post


Link to post
Share on other sites
i have a small solution for you. say you have particles 0-9999.
compare particle0 w/ 1-9999.
compare particle1 w/ 2-9999.
and so on...
this will cut the scan time in half. somethin else to do is only check by a radius of the particle.

hope this helps and makes since lol.
-adam

Share this post


Link to post
Share on other sites
Quote:
Original post by adam17
i have a small solution for you. say you have particles 0-9999.
compare particle0 w/ 1-9999.
compare particle1 w/ 2-9999.
and so on...
this will cut the scan time in half. somethin else to do is only check by a radius of the particle.

hope this helps and makes since lol.
-adam



compare particle1 w/ 2-9999. = FATAL FLAW
what if particle 2 or something collides with 1? then you cant see it!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
perhaps partitioning the 3d space into an octree. Then, for all particles in a section of the octree... check for collisions only with other particles inside that same section. Of course there is overhead to building (once at beginning) & updating the tree (frequently), but perhaps you can take advantage of such a construct in other ways too :)

Share this post


Link to post
Share on other sites
Some time ago, I was spending some time to pre-design what my particle system should provide and what should not.
This meant I had to think at the possible uses for a particle system and their relative implementation.
Implementing per-particle collision is hard. By sure means, it's not easy to get it fast.
By the way, I realized I really would not need this, so I raccomand to understand if your engine really needs the functionality.
Now, I often over-estimate engine tasks to put some extra effort here and there, so I have to update less often.
I realized however, I could not find a single task in which per-particle collisions were needed so I dropped the functionality at all.

Consider for example, small particles such as sparks. User is not expecting two sparks to collide. If they would:
- user won't notice OR (worse)
- will notice AND will possibly think it's strange.
So collision check would fail 99.99% of the time.

Considering big particles which usually collide, I realized they are not really particles. They are usually used to represent some sort of volume of nanometric particles (such as smog). This kind of masses does not produce any visible behaviour when collision occurs.
So, while collision check would pass a lot of times, it's non-trivial to manage the collision.

I also realized that big particles which produce visible collision behaviours are really not particles, in the sense they should be really treated as standard entities because they're probably big and detailed.
So, the problem was now to realize if I really needed to manage those entities. I decided I don't, it's a way too advanced feature right now, I wasn't able to realize why one would use this. So, it has been put last on the TODO list.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this