VR-Forces 4.1 Class Documentation
bhaveWanderAgent.h
Go to the documentation of this file.
1 /*
2 * Copyright 2010 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form.
5 */
6 
7 
8 
9 
13 
14 #ifndef KY_bhaveWanderAgent_H
15 #define KY_bhaveWanderAgent_H
16 
17 
19 #include <kyruntime/agents/wandertraversal.h>
20 #include <kyruntime/graph/traversalmanager.h>
22 
23 #include <kyruntime/core/pointwrapper.h>
24 #include <kyruntime/graph/pointinfo_vertexsafeptr.h>
25 #include <vrfobjcore/vrfObject.h>
26 
27 
28 namespace Kaim
29 {
30 
31 class GraphManager;
32 class PathFinder;
33 
34 
35 
41 {
42  KY_DEFINE_NEW_DELETE_OPERATORS
43 
44  friend class WanderTraversal;
45 
46 public:
49 
52 
57  KyResult Initialize(Bot& bot, TraversalManager::ConfigId traversalConfigId, TraversalManager::ConfigId restrictedTraversalConfigId);
58 
60  void Clear();
61 
63  void ReInit();
64 
67  KyBool Think();
68 
71  void SetGraph(GraphManager& graphManager);
72 
74  const GraphManager* GetGraph() const { return m_graphManager; }
75 
78  WanderTraversal* GetTraversal() const { return m_traversal; }
79 
86  void SetSpeed(const KyFloat32 speed);
87 
89  KyFloat32 GetSpeed() const { return m_speed; }
90 
92  const PointWrapper& GetDestination() const { return m_destination; }
93 
95  void SetDestination(Kaim::Vec3f fixedDestination);
96 
98  KyBool HasArrived() const { return m_hasArrived;}
99 
101  KyFloat32 GetDestinationTimeStamp() const { return m_destinationTimeStamp; }
102 
103  DtVrfObject* wanderArea() const { return myWanderArea; }
104  void setWanderArea(DtVrfObject* val) { myWanderArea = val; }
105 
106 private:
107  KyBool ComputeDestination();
108 
109 
110 private:
112 
115  TraversalManager::ConfigId myRestrictedTraversalConfigId;
116  WanderTraversal* m_traversal;
117  TraversalManager::ConfigId m_traversalConfigId;
118 
120  KyFloat32 m_destinationTimeStamp; //<Contains the date when destination was computed
121  PointWrapper m_destination;
122  PointInfo_VertexSafePtr m_destinationSafePtr;
123 
125  GraphManager* m_graphManager; //<Currently used graph
126 
128  PropagationBias_Wander m_bias;
130 
132  KyBool m_hasArrived; //<Boolean flag activated when entity reached its target point
133  KyFloat32 m_speed; //< Contains agents move speed
136 };
137 
138 } //Kaim
139 
140 #endif

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)