Antkeeper  0.0.1
Functions
ai::steering::behavior Namespace Reference

Functions

math::fvec3 flee (const agent &agent, const math::fvec3 &target)
 Attempts to steer an agent so that it moves away from a target. More...
 
math::fvec3 seek (const agent &agent, const math::fvec3 &target)
 Attempts to steer an agent so that it moves toward a target. More...
 
math::fvec3 wander_2d (const agent &agent, float noise, float distance, float radius, float &angle)
 Steers an agent in a continuously shifting random direction on the yaw plane. More...
 
math::fvec3 wander_3d (const agent &agent, float noise, float distance, float radius, float &theta, float &phi)
 Steers an agent in a continuously shifting random direction. More...
 

Function Documentation

◆ flee()

math::fvec3 ai::steering::behavior::flee ( const agent agent,
const math::fvec3 target 
)

Attempts to steer an agent so that it moves away from a target.

Parameters
agentAutonomous agent to steer.
targetTarget position.
Returns
Flee force.

Definition at line 26 of file flee.cpp.

◆ seek()

math::fvec3 ai::steering::behavior::seek ( const agent agent,
const math::fvec3 target 
)

Attempts to steer an agent so that it moves toward a target.

Parameters
agentAutonomous agent to steer.
targetTarget position.
Returns
Seek force.

Definition at line 26 of file seek.cpp.

◆ wander_2d()

math::fvec3 ai::steering::behavior::wander_2d ( const agent agent,
float  noise,
float  distance,
float  radius,
float &  angle 
)

Steers an agent in a continuously shifting random direction on the yaw plane.

Parameters
agentAutonomous agent to steer.
distanceDistance to the center of the wander circle.
noiseMaximum wander angle shift, in radians.
radiusRadius of the wander circle.
[in,out]angleAngular coordinate on the wander circle, in radians.
Returns
Wander force.

Definition at line 29 of file wander.cpp.

◆ wander_3d()

math::fvec3 ai::steering::behavior::wander_3d ( const agent agent,
float  noise,
float  distance,
float  radius,
float &  theta,
float &  phi 
)

Steers an agent in a continuously shifting random direction.

Parameters
agentAutonomous agent to steer.
distanceDistance to the wander sphere.
radiusRadius of the wander sphere.
deltaMaximum angle offset.
[in,out]thetaPolar wander angle, in radians.
[in,out]phiAzimuthal wander angle, in radians.
Returns
Wander force.

Definition at line 47 of file wander.cpp.