00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef __BASE_OBJECT_CLNT_H__
00014 #define __BASE_OBJECT_CLNT_H__
00015
00016
00017 #include "i_event_callback.h"
00018
00019
00020 #include <ltengineobjectsclient.h>
00021 #include <autoview/autoview.h>
00022
00023 #include <physics/collision_notify.h>
00024
00026 class LTCollisionSphere;
00027
00029 class CBaseObjectClnt : public BaseClassClient, public IEventCallback,
00030 public ILTCollisionNotify
00031 {
00032 public:
00033
00034 CBaseObjectClnt();
00035 virtual ~CBaseObjectClnt();
00036
00037 distr_class(CBaseObjectClnt);
00038
00039 virtual void Init();
00040
00041 virtual LTRESULT Update(float fFrameTime);
00042 virtual LTRESULT PhysicsUpdate(float fFrameTime);
00043
00044 virtual void Event(uint32 nEvent, float fFrameTime, float fGameTime,
00045 IEventData *pEventData, uint32 nPriority,
00046 ECallbackType eCT,
00047 uint32 nCountRemaining, float fTimeRemaining,
00048 float fLoopTime);
00049
00050 virtual void Notify( HOBJECT hobj, const LTContactInfo& info );
00051
00052 bool IsCameraSync() { return !m_nCameraSync; }
00053
00054 virtual uint32 OnPrecreate( ObjectCreateStruct* pOCS, float precreateType );
00055 virtual uint32 OnObjectCreated( float createType );
00056 virtual uint32 OnUpdate();
00057 virtual uint32 OnTouch( LTContactInfo* info, float force );
00058 virtual uint32 OnLinkBroken( HOBJECT linkObj );
00059 virtual uint32 OnModelStringKey( ArgList* pArgList );
00060 virtual uint32 OnCrush( HOBJECT crusherObj );
00061 virtual uint32 OnLoad( HMESSAGEREAD readMsg, float dwParam );
00062 virtual uint32 OnSave( HMESSAGEWRITE writeMsg, float dwParam );
00063 virtual uint32 OnAffectPhysics( ContainerPhysics* pCP );
00064 virtual uint32 OnParentAttachmentRemoved( );
00065 virtual uint32 GetForceUpdate( ForceUpdate* pFU );
00066 virtual uint32 OnActivate();
00067 virtual uint32 OnDeactivate();
00068 virtual uint32 OnAllObjectsCreated();
00069 virtual uint32 OnPositionChange( LTVector3f* p );
00070 virtual uint32 OnRotationChange( LTOrientation* R );
00071
00072 virtual void InitializePhysics();
00073 virtual ILTCollisionObject* CreateCollisionObject();
00074 virtual void UpdatePhysics( const LTVector3f* p );
00075 virtual void UpdatePhysics( const LTOrientation* R );
00076 virtual void CleanupPhysics();
00077
00078
00079 protected:
00080 bool m_bFirstUpdate;
00081
00082 void CameraSyncCB(const uint8 &nPrevValue);
00083
00084 distr_uint8_callback_fn(CBaseObjectClnt, m_nCameraSync, CameraSyncCB);
00085 distr_uint8_callback(m_nCameraSync, AVITEM_REG, 9, 0);
00086
00087 uint32 CreateClientFX(ArgList *pArgList, uint32 nStartCmd);
00088
00089 private:
00090 LTCollisionSphere* m_pCollSphere;
00091
00092
00093 };
00094
00095
00096 #endif // __BASE_OBJECT_CLNT_H__