00001 // ----------------------------------------------------------------------- // 00002 // 00003 // MODULE : boidmodel.h 00004 // 00005 // PURPOSE : CBoidModel object class - Definition 00006 // 00007 // CREATED : 03/26/01 00008 // 00009 // (c) 2001 LithTech, Inc. All Rights Reserved 00010 // 00011 // ----------------------------------------------------------------------- // 00028 #ifndef __BOID_MODEL_H__ 00029 #define __BOID_MODEL_H__ 00030 00031 #include "Aria.h" 00032 00033 // Engine includes 00034 #include <ltengineobjects.h> 00035 00037 class LTCollisionSphere; 00038 class Aviary; 00039 00041 00043 #define BOID_UPDATEINTERVAL 0.04f 00044 00046 class CBoidModel : public BaseClass 00047 { 00048 friend class Aviary; 00049 00050 public: 00051 // Construction / destruction 00052 CBoidModel(); 00053 virtual ~CBoidModel(); 00054 00055 // Overridden functions 00056 uint32 EngineMessageFn(uint32 messageID, void *pData, LTFLOAT fData); 00057 00058 // Additional methods 00059 LTRESULT SetAnimation(char *pAnimName); 00060 00061 // Accessors 00062 inline BoidDestination GetDestination() { return m_bdDest; } 00063 inline void SetDesination(BoidDestination bdDest) { m_bdDest = bdDest; } 00064 00065 inline BoidBehavior GetBehavior() { return m_bbStyle; } 00066 inline void SetBehavior(BoidBehavior bbStyle) { m_bbStyle = bbStyle; } 00067 00068 inline float GetScratch() { return m_fScratch; } 00069 inline void SetScratch(float fScratch) { m_fScratch = fScratch; } 00070 00071 inline void setAviary(Aviary *x) { m_aviary = x; } 00072 long getAge(); 00073 00074 Aviary * m_aviary; 00075 00076 protected: 00077 // EngineMessageFn handlers 00078 00079 uint32 PreCreate(void *pData, float fData); 00080 void ObjectCreated(); 00081 void Update(); 00082 00083 // Other functions 00084 void ReadProps(ObjectCreateStruct* pStruct); 00085 void PostReadProps(); 00086 00087 // Members 00088 LTVector3f m_vStartAnimDims; 00089 float m_fScale; 00090 float m_fMass; 00091 long m_nBirthTime; 00092 HMODELANIM m_hAnim; 00093 00094 // LTVector3f m_currDest; 00095 00096 LTCollisionSphere* m_pCollSphere; 00097 00098 private: 00099 BoidDestination m_bdDest; 00100 BoidBehavior m_bbStyle; 00101 float m_fScratch; 00102 }; 00103 00104 #endif // __BOID_MODEL_H__