VR-Forces 4.2 Class Documentation
List of all members | Classes | Public Member Functions | Protected Member Functions | Protected Attributes
Kaim::modFollowAgent Class Reference

The modFollowAgent is based on the FollowAgent, which makes a Bot follow another //! specified Body, at a given distance and at a given angle relative to the. More...

Classes

class  WorldObserver

Public Member Functions

 modFollowAgent ()
 STANDARD AGENT FUNCTIONS.
 ~modFollowAgent ()
KyResult Initialize (Bot &bot, TimeManager::TaskId computeRealDestinationTaskId)
void Clear ()
void ReInit ()
KyBool Think ()
void SetLeader (Body *target)
 ACCESSOR FUNCTIONS.
Body * GetLeader () const
void SetDistFromLeader (KyFloat32 distFromTarget)
KyFloat32 GetDistFromLeader () const
void SetAngleFromLeader (KyFloat32 angleFromTarget)
KyFloat32 GetAngleFromLeader () const
void SetMinimalImportantMove (const KyFloat32 value)
KyFloat32 GetMinimalImportantMove () const
void SetSpeed (const KyFloat32 speed)
KyFloat32 GetSpeed () const
void SetMaxTimeToReachIdealDestination (KyFloat32 interval)
const Vec3f & GetDestination () const
 AGENT STATE FEEDBACK.
KyBool HasArrived () const

Protected Member Functions

void computeAndLockDestination (Vec3f &offsetPosNow)
 SPECIFIC FUNCTIONS.
KyBool NeedRecomputation (Vec3f &offsetPosNow)
void computeVisibleDestination (Vec3f &idealPos)

Protected Attributes

Botm_bot
 AGENT MEMBER VALUES.
WorldObserver m_worldObserver
Body * m_leaderBody
 Behavior data.
KyFloat32 m_minDistBetweenAgents
KyFloat32 m_desiredDistFromLeader
KyFloat32 m_desiredAngleFromLeader
PointLockManager * m_pointLockManager
 Services.
TimeManager::TaskId m_computeRealDestinationTaskId
 service
KyFloat32 m_computeRealDistTimer
KyFloat32 m_minimalIntervalToReevaluate
KyFloat32 m_maximalIntervalToReachDestination
KyFloat32 m_timerToReach
ActionTorsoRotate * m_torsoRotateAttr
PointWrapper m_destination
 aim same direction leader is
PointInfo_NavTriangleId m_DestPointInfo
KyBool m_hasArrived
KyFloat32 m_desiredSpeed
 State data.
KyFloat32 m_leaderLastSpeed
KyBool m_useDistanceToLeaderMode
 the agent will aim to move at this speed at the follow position.
Vec3f m_lastIdealOffsetPos
 offset position, so it maintains a distance to its leader without regard to the desired angle offset.
KyFloat32 m_minimalImportantMove
 i.e. at the desired angle and distance from the leader.
KyFloat32 m_currentMaxAccel
 The current maximum acceleration and deceleration the entity is capable of.
KyFloat32 m_currentMaxDecel

Detailed Description

The modFollowAgent is based on the FollowAgent, which makes a Bot follow another //! specified Body, at a given distance and at a given angle relative to the.

Constructor & Destructor Documentation

Kaim::modFollowAgent::modFollowAgent ( )

STANDARD AGENT FUNCTIONS.

Kaim::modFollowAgent::~modFollowAgent ( )

Member Function Documentation

KyResult Kaim::modFollowAgent::Initialize ( Bot bot,
TimeManager::TaskId  computeRealDestinationTaskId 
)
Parameters
botThe Bot that will use the modFollowAgent.
computeRealDestinationTaskIdThe unique ID of a aperiodic task configured for the TraversalManager, which will be used to determine whether or not enough time remains in the current frame for the modFollowAgent to recompute its ideal destination.
void Kaim::modFollowAgent::Clear ( )
void Kaim::modFollowAgent::ReInit ( )
KyBool Kaim::modFollowAgent::Think ( )

Determines an appropriate destination point for the modFollowAgent based on the position of the Leader Bot, the distance to the Leader, and the desired following distance and angle set for the modFollowAgent. It then calls the PathFinder to move the modFollowAgent to the destination.

void Kaim::modFollowAgent::SetLeader ( Body *  target)

ACCESSOR FUNCTIONS.

Sets the Leader Body that the modFollowAgent will follow.

Referenced by Kaim::modFollowAgent::WorldObserver::OnDeactivateBody().

Body* Kaim::modFollowAgent::GetLeader ( ) const
inline

Retrieves the Leader Body that the modFollowAgent is currently following.

References m_leaderBody.

Referenced by Kaim::modFollowAgent::WorldObserver::OnDeactivateBody().

void Kaim::modFollowAgent::SetDistFromLeader ( KyFloat32  distFromTarget)

Determines the distance the modFollowAgent attempts to maintain between itself and its Leader Bot. meters any positive value or 0.0f 1.0f

KyFloat32 Kaim::modFollowAgent::GetDistFromLeader ( ) const
inline

Retrieves the value set through a call to SetDistFromLeader().

References m_desiredDistFromLeader.

void Kaim::modFollowAgent::SetAngleFromLeader ( KyFloat32  angleFromTarget)

Determines the angle the modFollowAgent attempts to maintain between the orientation of the Leader Body and the preferred destination. For example, the default value of 180.0 degrees means the modFollowAgent stays directly behind the Leader Body. degrees any negative or positive value 180.0f

KyFloat32 Kaim::modFollowAgent::GetAngleFromLeader ( ) const
inline

Retrieves the value set through a call to SetAngleFromLeader().

References m_desiredAngleFromLeader.

void Kaim::modFollowAgent::SetMinimalImportantMove ( const KyFloat32  value)

Determines the minimum distance the Leader Body must move in order to trigger a response from the modFollowAgent. If the Leader Body moves less than this value, the modFollowAgent will not re-evaluate its ideal destination. meters any positive value 1.0f

KyFloat32 Kaim::modFollowAgent::GetMinimalImportantMove ( ) const
inline

Retrieves the value set through a call to SetMinimalImportantMove().

References m_minimalImportantMove.

void Kaim::modFollowAgent::SetSpeed ( const KyFloat32  speed)

Determines the preferred speed at which the modFollowAgent should move. This preferred speed is capped to the value of the BodyMaxSpeed attribute set for the Bot using the modFollowAgent, if any. In addition, it may be altered by the current set of IModifier classes used by the PathFinder. meters per second any positive value The value of the BodyMaxSpeed attribute of the Bot if available, or 1.0f otherwise.

KyFloat32 Kaim::modFollowAgent::GetSpeed ( ) const
inline

Retrieves the value set through a call to SetSpeed().

References m_desiredSpeed.

void Kaim::modFollowAgent::SetMaxTimeToReachIdealDestination ( KyFloat32  interval)

Determines the maximum amount of time the modFollowAgent may spend trying to reach its destination point. When this time interval is exceeded, the modFollowAgent recalculates its ideal destination point.

const Vec3f& Kaim::modFollowAgent::GetDestination ( ) const
inline

AGENT STATE FEEDBACK.

Retrieves the current destination point of the modFollowAgent.

References m_destination.

KyBool Kaim::modFollowAgent::HasArrived ( ) const
inline

Indicates whether or not the modFollowAgent has arrived at its current destination point.

References m_hasArrived.

void Kaim::modFollowAgent::computeAndLockDestination ( Vec3f &  offsetPosNow)
protected

SPECIFIC FUNCTIONS.

KyBool Kaim::modFollowAgent::NeedRecomputation ( Vec3f &  offsetPosNow)
protected
void Kaim::modFollowAgent::computeVisibleDestination ( Vec3f &  idealPos)
protected

Member Data Documentation

Bot* Kaim::modFollowAgent::m_bot
protected

AGENT MEMBER VALUES.

WorldObserver Kaim::modFollowAgent::m_worldObserver
protected
Body* Kaim::modFollowAgent::m_leaderBody
protected

Behavior data.

Referenced by GetLeader().

KyFloat32 Kaim::modFollowAgent::m_minDistBetweenAgents
protected
KyFloat32 Kaim::modFollowAgent::m_desiredDistFromLeader
protected

Referenced by GetDistFromLeader().

KyFloat32 Kaim::modFollowAgent::m_desiredAngleFromLeader
protected

Referenced by GetAngleFromLeader().

PointLockManager* Kaim::modFollowAgent::m_pointLockManager
protected

Services.

TimeManager::TaskId Kaim::modFollowAgent::m_computeRealDestinationTaskId
protected

service

Time-slicing configuration

KyFloat32 Kaim::modFollowAgent::m_computeRealDistTimer
protected
KyFloat32 Kaim::modFollowAgent::m_minimalIntervalToReevaluate
protected
KyFloat32 Kaim::modFollowAgent::m_maximalIntervalToReachDestination
protected
KyFloat32 Kaim::modFollowAgent::m_timerToReach
protected
ActionTorsoRotate* Kaim::modFollowAgent::m_torsoRotateAttr
protected
PointWrapper Kaim::modFollowAgent::m_destination
protected

aim same direction leader is

Chosen destination

Referenced by GetDestination().

PointInfo_NavTriangleId Kaim::modFollowAgent::m_DestPointInfo
protected
KyBool Kaim::modFollowAgent::m_hasArrived
protected

Referenced by HasArrived().

KyFloat32 Kaim::modFollowAgent::m_desiredSpeed
protected

State data.

Referenced by GetSpeed().

KyFloat32 Kaim::modFollowAgent::m_leaderLastSpeed
protected
KyBool Kaim::modFollowAgent::m_useDistanceToLeaderMode
protected

the agent will aim to move at this speed at the follow position.

Vec3f Kaim::modFollowAgent::m_lastIdealOffsetPos
protected

offset position, so it maintains a distance to its leader without regard to the desired angle offset.

KyFloat32 Kaim::modFollowAgent::m_minimalImportantMove
protected

i.e. at the desired angle and distance from the leader.

Referenced by GetMinimalImportantMove().

KyFloat32 Kaim::modFollowAgent::m_currentMaxAccel
protected

The current maximum acceleration and deceleration the entity is capable of.

VRF can compute these based with consideration of slope, soils, and max entity speed, and provide them to the Agent so it can use them to set speed.

KyFloat32 Kaim::modFollowAgent::m_currentMaxDecel
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)