VR-Forces 4.3.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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);
105 
106  static void objectAboutToBeRemovedCallback(DtVrfObject*, void*);
107  virtual void processObjectAboutToBeRemoved(DtVrfObject*);
108 
109 private:
110  KyBool ComputeDestination();
111 
112 
113 private:
115 
118  TraversalManager::ConfigId myRestrictedTraversalConfigId;
119  WanderTraversal* m_traversal;
120  TraversalManager::ConfigId m_traversalConfigId;
121 
123  KyFloat32 m_destinationTimeStamp; //<Contains the date when destination was computed
124  PointWrapper m_destination;
125  PointInfo_VertexSafePtr m_destinationSafePtr;
126 
128  GraphManager* m_graphManager; //<Currently used graph
129 
131  PropagationBias_Wander m_bias;
133 
135  KyBool m_hasArrived; //<Boolean flag activated when entity reached its target point
136  KyFloat32 m_speed; //< Contains agents move speed
139 
143 };
144 
145 } //Kaim
146 
147 #endif

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)