Untold Engine  Beta v0.0.16
docs
U4DEngine::U4DSteering Class Reference

The U4DSteering class implements AI steering behaviors. More...

Inherited by U4DEngine::U4DArrive, U4DEngine::U4DFlee, and U4DEngine::U4DSeek.

Public Member Functions

 U4DSteering ()
 class constructor for steering behavior
 
 ~U4DSteering ()
 class destructor for steering behavior
 
virtual U4DVector3n getSteering (U4DDynamicAction *uAction, U4DVector3n &uTargetPosition)
 Computes the velocity for steering. More...
 
virtual U4DVector3n getSteering (U4DDynamicAction *uPursuer, U4DDynamicAction *uEvader)
 Computes the velocity for steering. More...
 
virtual U4DVector3n getSteering (U4DDynamicAction *uAction, std::vector< U4DSegment > &uPathContainer)
 Computes the velociry for steering along the provided path. More...
 
virtual U4DVector3n getSteering (U4DDynamicAction *uAction)
 Computes the velocity for steering. More...
 
void setMaxSpeed (float uMaxSpeed)
 sets the maximum speed for steering More...
 
virtual void setWanderOffset (float uWanderOffset)
 sets the wander offset used for the Wander steering behavior. This represents the distance offset between the pursuer and the wander target More...
 
virtual void setWanderRadius (float uWanderRadius)
 sets the wander circle radius for the Wander steering behavior More...
 
virtual void setWanderRate (float uWanderRate)
 sets the rate for the random number for wander target position More...
 
virtual void setPredictTime (float uPredictTime)
 sets the time in the future to predict the position More...
 
virtual void setPathOffset (float uPathOffset)
 set the distance along the path to generate the target position More...
 
virtual void setPathRadius (float uPathRadius)
 set the path radius More...
 
virtual int getCurrentPathIndex ()
 gets the current path the pursuer is following More...
 

Protected Attributes

float maxSpeed
 maximum speed for steering
 

Detailed Description

The U4DSteering class implements AI steering behaviors.

Member Function Documentation

◆ getCurrentPathIndex()

virtual int U4DEngine::U4DSteering::getCurrentPathIndex ( )
inlinevirtual

gets the current path the pursuer is following

Returns
index in the path(segment) vector

Reimplemented in U4DEngine::U4DFollowPath.

◆ getSteering() [1/4]

virtual U4DVector3n U4DEngine::U4DSteering::getSteering ( U4DDynamicAction uAction)
inlinevirtual

Computes the velocity for steering.

Parameters
uActionDynamic action represented as the pursuer
Returns
velocity vector to apply to 3D model

Reimplemented in U4DEngine::U4DAvoidance.

◆ getSteering() [2/4]

virtual U4DVector3n U4DEngine::U4DSteering::getSteering ( U4DDynamicAction uAction,
std::vector< U4DSegment > &  uPathContainer 
)
inlinevirtual

Computes the velociry for steering along the provided path.

Parameters
uActionDynamic action represented as the pursuer
uPathContainersegment vector representing the path the pursuer must follow
Returns
velocity vector to apply to 3D model

Reimplemented in U4DEngine::U4DFollowPath.

◆ getSteering() [3/4]

virtual U4DVector3n U4DEngine::U4DSteering::getSteering ( U4DDynamicAction uAction,
U4DVector3n uTargetPosition 
)
inlinevirtual

Computes the velocity for steering.

Parameters
uActionDynamic action represented as the pursuer
uTargetPositiontarget position in vector format
Returns
velocity vector to apply to 3D model

Reimplemented in U4DEngine::U4DWander, U4DEngine::U4DArrive, U4DEngine::U4DSeek, and U4DEngine::U4DFlee.

◆ getSteering() [4/4]

virtual U4DVector3n U4DEngine::U4DSteering::getSteering ( U4DDynamicAction uPursuer,
U4DDynamicAction uEvader 
)
inlinevirtual

Computes the velocity for steering.

Parameters
uPursuer3D model represented as the pursuer
uEvader3D model represented as the evader. Also known as the target
Returns
velocity vector to apply to 3D model

Reimplemented in U4DEngine::U4DPursuit.

◆ setMaxSpeed()

void U4DEngine::U4DSteering::setMaxSpeed ( float  uMaxSpeed)

sets the maximum speed for steering

Parameters
uMaxSpeedmaximum steering speed

◆ setPathOffset()

virtual void U4DEngine::U4DSteering::setPathOffset ( float  uPathOffset)
inlinevirtual

set the distance along the path to generate the target position

Parameters
uPathOffsetpath offset

Reimplemented in U4DEngine::U4DFollowPath.

◆ setPathRadius()

virtual void U4DEngine::U4DSteering::setPathRadius ( float  uPathRadius)
inlinevirtual

set the path radius

Parameters
uPathRadiusradius of path

Reimplemented in U4DEngine::U4DFollowPath.

◆ setPredictTime()

virtual void U4DEngine::U4DSteering::setPredictTime ( float  uPredictTime)
inlinevirtual

sets the time in the future to predict the position

Parameters
uPredictTimetime value

Reimplemented in U4DEngine::U4DFollowPath.

◆ setWanderOffset()

virtual void U4DEngine::U4DSteering::setWanderOffset ( float  uWanderOffset)
inlinevirtual

sets the wander offset used for the Wander steering behavior. This represents the distance offset between the pursuer and the wander target

Parameters
uWanderOffsetdistance offset

Reimplemented in U4DEngine::U4DWander.

◆ setWanderRadius()

virtual void U4DEngine::U4DSteering::setWanderRadius ( float  uWanderRadius)
inlinevirtual

sets the wander circle radius for the Wander steering behavior

Parameters
uWanderRadiusradius of wander circle

Reimplemented in U4DEngine::U4DWander.

◆ setWanderRate()

virtual void U4DEngine::U4DSteering::setWanderRate ( float  uWanderRate)
inlinevirtual

sets the rate for the random number for wander target position

Parameters
uWanderRatewander rate

Reimplemented in U4DEngine::U4DWander.