import Vector from '../../math/Vector'; import GroupBehavior from '../GroupBehavior'; import Proximity, { ProximityCallback } from '../Proximity'; import Limiter from '../Limiter'; import Steerable from '../Steerable'; import SteeringAcceleration from '../SteeringAcceleration'; /** * {@code CollisionAvoidance} behavior steers the owner to avoid obstacles lying in its path. An obstacle is any object that can be * approximated by a circle (or sphere, if you are working in 3D). *
* This implementation uses collision prediction working out the closest approach of two agents and determining if their distance * at this point is less than the sum of their bounding radius. For avoiding groups of characters, averaging positions and * velocities do not work well with this approach. Instead, the algorithm needs to search for the character whose closest approach * will occur first and to react to this character only. Once this imminent collision is avoided, the steering behavior can then * react to more distant characters. *
* This algorithm works well with small and/or moving obstacles whose shape can be approximately represented by a center and a
* radius.
*
* @param