Creates count members around home, each placed where the environment is usable (else at home),
swimming in random horizontal directions. Everything is drawn from seed.
ReadonlycountMembers.
Where the flock may be.
ReadonlyheadingWander heading per member, radians.
ReadonlyhomeHome position the flock is leashed to.
Steering parameters (may be changed between steps).
ReadonlypositionPositions, xyz per member.
Steps taken so far.
ReadonlyvelocityVelocities, xyz per member.
Advances the flock by one fixed step of dt seconds. predators are fled from.
A flock (fish school, bird flock, herd) simulated with boids on the CPU. Positions and velocities are float64 in whatever coordinates the environment uses (a world's local frame). Pure, seeded and fixed-step: call Flock.step with the same
dtand you get the same flock everywhere.O(n²) neighbour search per step.