[How To Calculate New position and direction]
1. position = position + velocity * dt + 1/2 * acceleration * dt * dt
2. velocity = velocity + acceleration * dt
3. keep max velocity
4. calculate heading(yaw)
5. calculate accelerator
0. update all boid’s info : visibility, the closest neighbor boid in visible range
a. check collision with objects using bound box, distance
b. check flocking center (opt. center of a boid’s cover range, target)
c. check keep distance with the closest neighbor boid
d. check velocity of the closest neighbor boid
e. check predator range
* calculate accelerator through a ~ e steps.
* not bidirectional the closest neighbor : if A choose B as the closest neighbor, B can
not select A.
6. render position/rotation
It was little bit slower than I expected.
I put skipping from accelerator b step to e step according how many boids are running.