|
|
|
This program uses reynolds flocking behaviour. Three factors are taken into account: each fish tries to keep a minimum collision distance. They also try to match velocity with other fish. Third, the try to center themselves relative to neighbours. Each of these desires results in an acceleration. the final acceleration is a weighed result of all accelerations. Accelerations are clipped. Likewise, maximum velocity is clipped too. Greatest priority is given to collision avoidance, then to flock centering.If we still have energy left we try velocity matching.
see paper at http://www.red3d.com/cwr/papers/1999/gdc99steer.html
Issues:
Sometimes forces cancel out and the fish stalls.I have tried to give a default velocity for that case but it does not look too good.
|
|