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 Type of vector, either 2D or 3D, implementing the {@link Vector} interface * * @author davebaol */ declare class CollisionAvoidance> extends GroupBehavior implements ProximityCallback { private shortestTime; private firstNeighbor; private firstMinSeparation; private firstDistance; private firstRelativePosition; private firstRelativeVelocity; private relativePosition; private relativeVelocity; /** * Creates a {@code CollisionAvoidance} behavior for the specified owner and proximity. * @param owner the owner of this behavior * @param proximity the proximity of this behavior. */ constructor(owner: Steerable, proximity: Proximity); reportNeighbor(neighbor: Steerable): boolean; setOwner(owner: Steerable): CollisionAvoidance; setEnabled(enabled: boolean): CollisionAvoidance; /** * Sets the limiter of this steering behavior. The given limiter must at least take care of the maximum linear acceleration. * @return this behavior for chaining. */ setLimiter(limiter: Limiter): CollisionAvoidance; protected calculateRealSteering(steering: SteeringAcceleration): SteeringAcceleration; } export default CollisionAvoidance;