VR-Forces 4.2 Class Documentation
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends
Kaim::bhaveWanderAgent Class Reference

Public Member Functions

 bhaveWanderAgent ()
 ~bhaveWanderAgent ()
KyResult Initialize (Bot &bot, TraversalManager::ConfigId traversalConfigId, TraversalManager::ConfigId restrictedTraversalConfigId)
void Clear ()
void ReInit ()
KyBool Think ()
void SetGraph (GraphManager &graphManager)
const GraphManager * GetGraph () const
WanderTraversalGetTraversal () const
void SetSpeed (const KyFloat32 speed)
KyFloat32 GetSpeed () const
const PointWrapper & GetDestination () const
void SetDestination (Kaim::Vec3f fixedDestination)
KyBool HasArrived () const
KyFloat32 GetDestinationTimeStamp () const
DtVrfObjectwanderArea () const
void setWanderArea (DtVrfObject *val)
virtual void processObjectAboutToBeRemoved (DtVrfObject *)

Static Public Member Functions

static void objectAboutToBeRemovedCallback (DtVrfObject *, void *)

Private Member Functions

KyBool ComputeDestination ()

Private Attributes

Botm_bot
BHAVE::DtRestrictedWanderTraversalmyRestrictedTraversal
 Time-Sliced Traversal.
TraversalManager::ConfigId myRestrictedTraversalConfigId
WanderTraversalm_traversal
TraversalManager::ConfigId m_traversalConfigId
KyFloat32 m_destinationTimeStamp
 Chosen destination.
PointWrapper m_destination
PointInfo_VertexSafePtr m_destinationSafePtr
GraphManager * m_graphManager
 Hiding graph and related FindNearestData.
PropagationBias_Wander m_bias
 Bias that is used to find a wander point.
BHAVE::PropagationBias_RestrictedWander myRestrictedBias
KyBool m_hasArrived
 State data.
KyFloat32 m_speed
DtVrfObjectmyWanderArea
bool myUsingFixedDestination
bool myWanderAreaRemoved
 If wander area is removed, this flag is set and next think returns false.
bool myWarnedOnce

Friends

class WanderTraversal

Detailed Description

The bhaveWanderAgent makes a Bot wander around the world at random. Each time it reaches a destination, it chooses a new vertex at random and moves there, repeating the process indefinitely. For details on using the bhaveWanderAgent, see :USERGUIDE:"Wandering".

Constructor & Destructor Documentation

Kaim::bhaveWanderAgent::bhaveWanderAgent ( )
Kaim::bhaveWanderAgent::~bhaveWanderAgent ( )

Member Function Documentation

KyResult Kaim::bhaveWanderAgent::Initialize ( Bot bot,
TraversalManager::ConfigId  traversalConfigId,
TraversalManager::ConfigId  restrictedTraversalConfigId 
)
Parameters
botThe Bot that will use the HideAgent.
traversalConfigIdThe unique ID of a WanderTraversal instance configured for the TraversalManager.
restrictedTraversalConfigIdThe unique ID of a RestrictedWanderTraversal instance configured for the TraversalManager.
void Kaim::bhaveWanderAgent::Clear ( )
void Kaim::bhaveWanderAgent::ReInit ( )
KyBool Kaim::bhaveWanderAgent::Think ( )

Invokes the WanderTraversal to pick a destination at random, and invokes the PathFinder to move the Bot toward that destination.

void Kaim::bhaveWanderAgent::SetGraph ( GraphManager &  graphManager)

Sets the GraphManager that contains the set of that the bhaveWanderAgent should search for a hidden destination point.

const GraphManager* Kaim::bhaveWanderAgent::GetGraph ( ) const
inline

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

WanderTraversal* Kaim::bhaveWanderAgent::GetTraversal ( ) const
inline

Retrieves the WanderTraversal currently in use by the bhaveWanderAgent, or #KY_NULL if the bhaveWanderAgent is not currently using a WanderTraversal.

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

Determines the preferred speed at which the bhaveWanderAgent should move. This preferred speed is capped to the value of the BodyMaxSpeed attribute set for the Bot using the bhaveWanderAgent, 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::bhaveWanderAgent::GetSpeed ( ) const
inline

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

const PointWrapper& Kaim::bhaveWanderAgent::GetDestination ( ) const
inline

Retrieves the destination chosen by the bhaveWanderAgent, or #KY_NULL if it has not yet found a random destination.

void Kaim::bhaveWanderAgent::SetDestination ( Kaim::Vec3f  fixedDestination)

mak - This is the only added thing in here, and the reason why this class is copied

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

Indicates whether or not the bhaveWanderAgent has arrived at its chosen destination.

KyFloat32 Kaim::bhaveWanderAgent::GetDestinationTimeStamp ( ) const
inline

Retrieves the time at which the bhaveWanderAgent last calculated its destination.

DtVrfObject* Kaim::bhaveWanderAgent::wanderArea ( ) const
inline
void Kaim::bhaveWanderAgent::setWanderArea ( DtVrfObject val)
static void Kaim::bhaveWanderAgent::objectAboutToBeRemovedCallback ( DtVrfObject ,
void *   
)
static
virtual void Kaim::bhaveWanderAgent::processObjectAboutToBeRemoved ( DtVrfObject )
virtual
KyBool Kaim::bhaveWanderAgent::ComputeDestination ( )
private

Friends And Related Function Documentation

friend class WanderTraversal
friend

Member Data Documentation

Bot* Kaim::bhaveWanderAgent::m_bot
private
BHAVE::DtRestrictedWanderTraversal* Kaim::bhaveWanderAgent::myRestrictedTraversal
private

Time-Sliced Traversal.

TraversalManager::ConfigId Kaim::bhaveWanderAgent::myRestrictedTraversalConfigId
private
WanderTraversal* Kaim::bhaveWanderAgent::m_traversal
private
TraversalManager::ConfigId Kaim::bhaveWanderAgent::m_traversalConfigId
private
KyFloat32 Kaim::bhaveWanderAgent::m_destinationTimeStamp
private

Chosen destination.

PointWrapper Kaim::bhaveWanderAgent::m_destination
private
PointInfo_VertexSafePtr Kaim::bhaveWanderAgent::m_destinationSafePtr
private
GraphManager* Kaim::bhaveWanderAgent::m_graphManager
private

Hiding graph and related FindNearestData.

PropagationBias_Wander Kaim::bhaveWanderAgent::m_bias
private

Bias that is used to find a wander point.

BHAVE::PropagationBias_RestrictedWander Kaim::bhaveWanderAgent::myRestrictedBias
private
KyBool Kaim::bhaveWanderAgent::m_hasArrived
private

State data.

KyFloat32 Kaim::bhaveWanderAgent::m_speed
private
DtVrfObject* Kaim::bhaveWanderAgent::myWanderArea
private
bool Kaim::bhaveWanderAgent::myUsingFixedDestination
private
bool Kaim::bhaveWanderAgent::myWanderAreaRemoved
private

If wander area is removed, this flag is set and next think returns false.

bool Kaim::bhaveWanderAgent::myWarnedOnce
private

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)