We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aea366f commit cbf68a1Copy full SHA for cbf68a1
processing-mode/example3/java/src/main/java/test/Boid.java
@@ -136,6 +136,10 @@ protected PVector separate(ArrayList<Boid> boids) {
136
int count = 0;
137
// For every boid in the system, check if it's too close
138
for (Boid other : boids) {
139
+ // ignore boids in other clusters
140
+ if (other.clusterLabel != clusterLabel) {
141
+ continue;
142
+ }
143
float d = PVector.dist(position, other.position);
144
// If the distance is greater than 0 and less than an arbitrary amount (0 when
145
// you are yourself)
0 commit comments