![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /* 00002 * Copyright 2010 Autodesk, Inc. All rights reserved. 00003 * Use of this software is subject to the terms of the Autodesk license agreement provided at the time of installation or download, 00004 * or which otherwise accompanies this software in either electronic or hard copy form. 00005 */ 00006 00007 00008 00009 00013 00014 #ifndef KY_bhaveWanderAgent_H 00015 #define KY_bhaveWanderAgent_H 00016 00017 00018 #include <bhaveSim/bhaveSimDefines.h> 00019 #include <kyruntime/agents/wandertraversal.h> 00020 #include <kyruntime/graph/traversalmanager.h> 00021 #include <bhaveSim/restrictedWanderTraversal.h> 00022 00023 #include <kyruntime/core/pointwrapper.h> 00024 #include <kyruntime/graph/pointinfo_vertexsafeptr.h> 00025 #include <vrfobjcore/vrfObject.h> 00026 00027 00028 namespace Kaim 00029 { 00030 00031 class GraphManager; 00032 class PathFinder; 00033 00034 00035 00040 class DT_DLL_bhaveSim bhaveWanderAgent 00041 { 00042 KY_DEFINE_NEW_DELETE_OPERATORS 00043 00044 friend class WanderTraversal; 00045 00046 public: 00048 bhaveWanderAgent(); 00049 00051 ~bhaveWanderAgent(); 00052 00057 KyResult Initialize(Bot& bot, TraversalManager::ConfigId traversalConfigId, TraversalManager::ConfigId restrictedTraversalConfigId); 00058 00060 void Clear(); 00061 00063 void ReInit(); 00064 00067 KyBool Think(); 00068 00071 void SetGraph(GraphManager& graphManager); 00072 00074 const GraphManager* GetGraph() const { return m_graphManager; } 00075 00078 WanderTraversal* GetTraversal() const { return m_traversal; } 00079 00086 void SetSpeed(const KyFloat32 speed); 00087 00089 KyFloat32 GetSpeed() const { return m_speed; } 00090 00092 const PointWrapper& GetDestination() const { return m_destination; } 00093 00095 void SetDestination(Kaim::Vec3f fixedDestination); 00096 00098 KyBool HasArrived() const { return m_hasArrived;} 00099 00101 KyFloat32 GetDestinationTimeStamp() const { return m_destinationTimeStamp; } 00102 00103 DtVrfObject* wanderArea() const { return myWanderArea; } 00104 void setWanderArea(DtVrfObject* val) { myWanderArea = val; } 00105 00106 private: 00107 KyBool ComputeDestination(); 00108 00109 00110 private: 00111 Bot* m_bot; 00112 00114 BHAVE::DtRestrictedWanderTraversal* myRestrictedTraversal; 00115 TraversalManager::ConfigId myRestrictedTraversalConfigId; 00116 WanderTraversal* m_traversal; 00117 TraversalManager::ConfigId m_traversalConfigId; 00118 00120 KyFloat32 m_destinationTimeStamp; //<Contains the date when destination was computed 00121 PointWrapper m_destination; 00122 PointInfo_VertexSafePtr m_destinationSafePtr; 00123 00125 GraphManager* m_graphManager; //<Currently used graph 00126 00128 PropagationBias_Wander m_bias; 00129 BHAVE::PropagationBias_RestrictedWander myRestrictedBias; 00130 00132 KyBool m_hasArrived; //<Boolean flag activated when entity reached its target point 00133 KyFloat32 m_speed; //< Contains agents move speed 00134 DtVrfObject* myWanderArea; 00135 bool myUsingFixedDestination; 00136 }; 00137 00138 } //Kaim 00139 00140 #endif //! KY_bhaveWanderAgent_H