00001 00032 #ifndef LL_LLAGENTPILOT_H 00033 #define LL_LLAGENTPILOT_H 00034 00035 #include "stdtypes.h" 00036 #include "lltimer.h" 00037 #include "v3dmath.h" 00038 #include "lldarray.h" 00039 00040 // Class that drives the agent around according to a "script". 00041 00042 class LLAgentPilot 00043 { 00044 public: 00045 enum EActionType 00046 { 00047 STRAIGHT, 00048 TURN 00049 }; 00050 00051 LLAgentPilot(); 00052 virtual ~LLAgentPilot(); 00053 00054 void load(const char *filename); 00055 void save(const char *filename); 00056 00057 void startRecord(); 00058 void stopRecord(); 00059 void addAction(enum EActionType action); 00060 00061 void startPlayback(); 00062 void stopPlayback(); 00063 00064 void updateTarget(); 00065 00066 static void startRecord(void *); 00067 static void addWaypoint(void *); 00068 static void saveRecord(void *); 00069 static void startPlayback(void *); 00070 static void stopPlayback(void *); 00071 static BOOL sLoop; 00072 00073 S32 mNumRuns; 00074 BOOL mQuitAfterRuns; 00075 private: 00076 void setAutopilotTarget(const S32 id); 00077 00078 BOOL mRecording; 00079 F32 mLastRecordTime; 00080 00081 BOOL mStarted; 00082 BOOL mPlaying; 00083 S32 mCurrentAction; 00084 00085 class Action 00086 { 00087 public: 00088 00089 EActionType mType; 00090 LLVector3d mTarget; 00091 F64 mTime; 00092 }; 00093 00094 LLDynamicArray<Action> mActions; 00095 LLTimer mTimer; 00096 }; 00097 00098 extern LLAgentPilot gAgentPilot; 00099 00100 #endif // LL_LLAGENTPILOT_H