3 ms·
If you did that the later boids in the list wouldn't know about any of their own neighbors.
by plopz 8y ago
If you did that the later boids in the list wouldn't know about any of their own neighbors.
- fromthestart 8y agoIn the current implementation, yes. But the code should be structured to append neighbors to both boids[i] and boids[j] simultaneously. This is especially critical in physics simulations like these, where niave particle interaction algorithms can be an expensive O(n^2).