My Project
AITasks.h
1 #pragma once
2 
3 #include <list>
4 #include <vector>
5 
6 namespace ParaEngine
7 {
8  using namespace std;
19  {
20  public:
21 
22  struct Keyframe
23  {
29  string sAnimation;
33  float fFacing;
35  float fDuration;
36  Keyframe();
37  Keyframe(const char* anim, float x, float y, float z, float facing, float duration);
38  };
39 
40  public:
41  list <Keyframe> listKeyframes;
43  float fStartTime;
46 
47 
49  AITask_MovieTrack(const char * str);
50  };
51 
53  {
54  public:
57 
58  AITask_DieAndReborn(float fRebornTimeLeft)
59  {
60  m_fRebornTimeLeft = fRebornTimeLeft;
61  };
62  };
63 
65  {
66  public:
67  float m_fX, m_fY;
68  float m_fRadius;
69 
70  AITask_WanderNearby(float fRadius, float fX, float fY)
71  {
72  m_fRadius = fRadius;
73  m_fX = fX;
74  m_fY = fY;
75  };
76  };
77 
78  struct AITask_Evade
79  {
80  public:
81  char m_sTarget[20];
83  float m_fDist1;
85  float m_fDist2;
86 
87  AITask_Evade(const char* target, float distance1, float distance2);
88  AITask_Evade(const char *);
89  };
90 
91  class CBipedObject;
93  {
94  public:
95  char m_sTarget[20];
97  float m_fDist1;
99  float m_fDist2;
100  CBipedObject* m_pTarget;
101 
102  AITask_Follow(const char* target, float distance1, float distance2);
103  AITask_Follow(const char *);
104  };
105 
109  struct AITask
110  {
111  public:
112  enum AITaskType {
113  DieAndReborn = 0,
114  WanderNearby = 1,
115  Evade=2,
116  Follow=3,
117  Movie=4
118  }m_nType;
121  union
122  {
123  AITask_DieAndReborn* pAITask_DieAndReborn;
124  AITask_WanderNearby* pAITask_WanderNearby;
125  AITask_Evade* pAITask_Evade;
126  AITask_Follow* pAITask_Follow;
127  AITask_MovieTrack* pAITask_Movie;
128  void* pAITask; //anomynous
129  };
130  public:
131  AITask();
132  AITask(AITaskType type, void* pt);
133  void DestroyMe();
134  };
135 }
float m_fDist1
distance within which to stop and start attacking
Definition: AITasks.h:83
Definition: AITasks.h:78
different physics engine has different winding order.
Definition: EventBinding.h:32
float m_fDist2
distance outside which to start following
Definition: AITasks.h:99
float fDuration
time (in seconds) within which this frame must end, and proceed to the next one in the list ...
Definition: AITasks.h:35
Vector3 vPos
position of the biped when this frame ends
Definition: AITasks.h:31
Standard 3-dimensional vector.
Definition: ParaVector3.h:16
string sAnimation
object will always walk to the position (vPos), during which time (sAnimation) is played...
Definition: AITasks.h:29
float fFacing
facing of the biped when this frame ends
Definition: AITasks.h:33
Definition: AITasks.h:92
Definition: AITasks.h:64
a union of all kinds of task defined
Definition: AITasks.h:109
float m_fDist1
distance within which to stop following
Definition: AITasks.h:97
bool m_bIsFinished
set to true if finished
Definition: AITasks.h:120
float m_fDist2
distance within which to retreat to dist1
Definition: AITasks.h:85
float m_fRebornTimeLeft
in seconds
Definition: AITasks.h:56
data structures used to describe the task that a AI module is planning to do or is currently doing th...
Definition: AITasks.h:18
Definition: AITasks.h:52
float fStartTime
how long a frame has been playing
Definition: AITasks.h:43
float fPathFindingTime
For how long the biped has been finding to reach its position specified in a key frame.
Definition: AITasks.h:45
It can be used to represent biped object(like human, re spawning monsters) in the scene without inher...
Definition: BipedObject.h:60