Flint Particle System Forum - Number of neighbors? Thu, 23 Jun 2011 13:24:02 +0100 http://flintparticles.org/forum/ Lussumo Vanilla 1.1.10 & Feed Publisher Number of neighbors? http://flintparticles.org/forum/comments.php?DiscussionID=248&Focus=895#Comment_895 http://flintparticles.org/forum/comments.php?DiscussionID=248&Focus=895#Comment_895 Mon, 10 Aug 2009 14:46:40 +0100 kytom
Thank you for the awesome particle engine. Just learning this thing, and ran into an issue...

I want to create a certain effect based on the 'energy' of the particle, where energy is a number of its neighbors. Is there some easy way of determining it, or should I implement one myself?

TIA and cheers :) ]]>
Number of neighbors? http://flintparticles.org/forum/comments.php?DiscussionID=248&Focus=897#Comment_897 http://flintparticles.org/forum/comments.php?DiscussionID=248&Focus=897#Comment_897 Wed, 12 Aug 2009 08:12:35 +0100 Richard
You'll probably need a custom action for this. Some of the existing actions (like ApproachNeighbours) relate to the number and location of neighbours, but it doesn't sound like you want any of the specific actions already implemented in the library. You might find the source code for ApproachNeighbours useful in implementing your own solution.

Richard ]]>
Number of neighbors? http://flintparticles.org/forum/comments.php?DiscussionID=248&Focus=906#Comment_906 http://flintparticles.org/forum/comments.php?DiscussionID=248&Focus=906#Comment_906 Thu, 27 Aug 2009 09:28:37 +0100 kytom
I made my own action based on ApproachNeighbours, exactly how you said, though if I wanted to optimize it better, especially in case of a large number of particles, I think the best solution would be to implement a grid-based solution, like Grant did in his ProximityManager.

Cheers :) ]]>
Number of neighbors? http://flintparticles.org/forum/comments.php?DiscussionID=248&Focus=908#Comment_908 http://flintparticles.org/forum/comments.php?DiscussionID=248&Focus=908#Comment_908 Tue, 01 Sep 2009 07:44:14 +0100 Richard