3 ms·
Yep got it. Thanks. Feels a good idea. Have to try it to know for sure.
by anoopelias 12y ago
Yep got it. Thanks.
Feels a good idea. Have to try it to know for sure.
- repsilat 12y agoOne important thing to note while implementing it is that you have to be a little smart about how you move boids from one bin to another. You don't want to get quadratic behaviour because you're removing individual boids from the middle of lists again and again, you don't want to accidentally move a boid twice in an iteration and so on. The best way to do this is to make a list of "boids to add" and "boids to delete" for each bin, which you build as you call "move", and which you apply after you've done your movement calculations on all of your boids.
- anoopelias 12y agoThere are a few ways to be clever on going about it. One as you mentioned is to do a two phase scan one to move and one to correct the bins. Also instead of a square shaped range you can get a hexagonal range by dividing corner boxes diagonally to two and then checking which half of square the boid is. :)