00001 #ifndef _ODE_PROJECTILE_H
00002 #define _ODE_PROJECTILE_H
00003
00004 #include "MercuryODE.h"
00005 #include "MercuryShapes.h"
00006
00007 class Projectile : public MercuryODEObjectLoadable
00008 {
00009 public:
00010 Projectile() { }
00011 Projectile( const MString & sName ) { SetName( sName ); }
00012 ~Projectile();
00013 virtual void Init();
00014 virtual bool Collide( MercuryODEObject * pHit, dContact & pContact, MercuryODEWorld * pWorld );
00015 virtual void Message( int Message, PStack & data, const MString & name );
00016 virtual void Update( const float dTime );
00017
00018 void NotifyClass( MercuryObject * pToNotify, const MString & sMessage ) { m_pToNotify = pToNotify; m_sMessage=sMessage; }
00019 void EnableForShot( dSpaceID sID, float fLength, const MercuryPoint & pCenter, const MercuryPoint & pDirection );
00020 void Disable();
00021 CLASS_RTTI( Projectile, MercuryODEObjectLoadable );
00022 private:
00023 dGeomID m_pRay;
00024 MercuryObject * m_pToNotify;
00025 MString m_sMessage;
00026 MercuryShape m_shpTracer;
00027 };
00028
00029 class VirtualProjectile : public MercuryODEObject
00030 {
00031 public:
00032 VirtualProjectile()
00033 :MercuryODEObject(), m_pRay(0), m_pToNotify(NULL)
00034 {}
00035
00036 virtual void Init();
00037 virtual bool Collide( MercuryODEObject* pHit, dContact& pContact, MercuryODEWorld* pWorld );
00038 inline void NotifyClass( MercuryObject* pToNotify, const MString & sMessage ) { m_pToNotify = pToNotify; m_sMessage=sMessage; }
00039 void EnableForShot( dSpaceID sID, float fLength, const MercuryPoint & pCenter, const MercuryPoint & pDirection );
00040 void Disable();
00041 CLASS_RTTI( VirtualProjectile, MercuryODEObject );
00042 protected:
00043 dGeomID m_pRay;
00044 MercuryObject* m_pToNotify;
00045 MString m_sMessage;
00046 };
00047
00048 #endif
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076