Entity.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525
  1. /*
  2. ===========================================================================
  3. Doom 3 GPL Source Code
  4. Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
  5. This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
  6. Doom 3 Source Code is free software: you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. Doom 3 Source Code is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
  16. In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
  17. If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
  18. ===========================================================================
  19. */
  20. #ifndef __GAME_ENTITY_H__
  21. #define __GAME_ENTITY_H__
  22. /*
  23. ===============================================================================
  24. Game entity base class.
  25. ===============================================================================
  26. */
  27. static const int DELAY_DORMANT_TIME = 3000;
  28. extern const idEventDef EV_PostSpawn;
  29. extern const idEventDef EV_FindTargets;
  30. extern const idEventDef EV_Touch;
  31. extern const idEventDef EV_Use;
  32. extern const idEventDef EV_Activate;
  33. extern const idEventDef EV_ActivateTargets;
  34. extern const idEventDef EV_Hide;
  35. extern const idEventDef EV_Show;
  36. extern const idEventDef EV_GetShaderParm;
  37. extern const idEventDef EV_SetShaderParm;
  38. extern const idEventDef EV_SetOwner;
  39. extern const idEventDef EV_GetAngles;
  40. extern const idEventDef EV_SetAngles;
  41. extern const idEventDef EV_SetLinearVelocity;
  42. extern const idEventDef EV_SetAngularVelocity;
  43. extern const idEventDef EV_SetSkin;
  44. extern const idEventDef EV_StartSoundShader;
  45. extern const idEventDef EV_StopSound;
  46. extern const idEventDef EV_CacheSoundShader;
  47. // Think flags
  48. enum {
  49. TH_ALL = -1,
  50. TH_THINK = 1, // run think function each frame
  51. TH_PHYSICS = 2, // run physics each frame
  52. TH_ANIMATE = 4, // update animation each frame
  53. TH_UPDATEVISUALS = 8, // update renderEntity
  54. TH_UPDATEPARTICLES = 16
  55. };
  56. //
  57. // Signals
  58. // make sure to change script/doom_defs.script if you add any, or change their order
  59. //
  60. typedef enum {
  61. SIG_TOUCH, // object was touched
  62. SIG_USE, // object was used
  63. SIG_TRIGGER, // object was activated
  64. SIG_REMOVED, // object was removed from the game
  65. SIG_DAMAGE, // object was damaged
  66. SIG_BLOCKED, // object was blocked
  67. SIG_MOVER_POS1, // mover at position 1 (door closed)
  68. SIG_MOVER_POS2, // mover at position 2 (door open)
  69. SIG_MOVER_1TO2, // mover changing from position 1 to 2
  70. SIG_MOVER_2TO1, // mover changing from position 2 to 1
  71. NUM_SIGNALS
  72. } signalNum_t;
  73. // FIXME: At some point we may want to just limit it to one thread per signal, but
  74. // for now, I'm allowing multiple threads. We should reevaluate this later in the project
  75. #define MAX_SIGNAL_THREADS 16 // probably overkill, but idList uses a granularity of 16
  76. struct signal_t {
  77. int threadnum;
  78. const function_t *function;
  79. };
  80. class signalList_t {
  81. public:
  82. idList<signal_t> signal[ NUM_SIGNALS ];
  83. };
  84. class idEntity : public idClass {
  85. public:
  86. static const int MAX_PVS_AREAS = 4;
  87. int entityNumber; // index into the entity list
  88. int entityDefNumber; // index into the entity def list
  89. idLinkList<idEntity> spawnNode; // for being linked into spawnedEntities list
  90. idLinkList<idEntity> activeNode; // for being linked into activeEntities list
  91. idLinkList<idEntity> snapshotNode; // for being linked into snapshotEntities list
  92. int snapshotSequence; // last snapshot this entity was in
  93. int snapshotBits; // number of bits this entity occupied in the last snapshot
  94. idStr name; // name of entity
  95. idDict spawnArgs; // key/value pairs used to spawn and initialize entity
  96. idScriptObject scriptObject; // contains all script defined data for this entity
  97. int thinkFlags; // TH_? flags
  98. int dormantStart; // time that the entity was first closed off from player
  99. bool cinematic; // during cinematics, entity will only think if cinematic is set
  100. renderView_t * renderView; // for camera views from this entity
  101. idEntity * cameraTarget; // any remoteRenderMap shaders will use this
  102. idList< idEntityPtr<idEntity> > targets; // when this entity is activated these entities entity are activated
  103. int health; // FIXME: do all objects really need health?
  104. struct entityFlags_s {
  105. bool notarget :1; // if true never attack or target this entity
  106. bool noknockback :1; // if true no knockback from hits
  107. bool takedamage :1; // if true this entity can be damaged
  108. bool hidden :1; // if true this entity is not visible
  109. bool bindOrientated :1; // if true both the master orientation is used for binding
  110. bool solidForTeam :1; // if true this entity is considered solid when a physics team mate pushes entities
  111. bool forcePhysicsUpdate :1; // if true always update from the physics whether the object moved or not
  112. bool selected :1; // if true the entity is selected for editing
  113. bool neverDormant :1; // if true the entity never goes dormant
  114. bool isDormant :1; // if true the entity is dormant
  115. bool hasAwakened :1; // before a monster has been awakened the first time, use full PVS for dormant instead of area-connected
  116. bool networkSync :1; // if true the entity is synchronized over the network
  117. } fl;
  118. public:
  119. ABSTRACT_PROTOTYPE( idEntity );
  120. idEntity();
  121. ~idEntity();
  122. void Spawn( void );
  123. void Save( idSaveGame *savefile ) const;
  124. void Restore( idRestoreGame *savefile );
  125. const char * GetEntityDefName( void ) const;
  126. void SetName( const char *name );
  127. const char * GetName( void ) const;
  128. virtual void UpdateChangeableSpawnArgs( const idDict *source );
  129. // clients generate views based on all the player specific options,
  130. // cameras have custom code, and everything else just uses the axis orientation
  131. virtual renderView_t * GetRenderView();
  132. // thinking
  133. virtual void Think( void );
  134. bool CheckDormant( void ); // dormant == on the active list, but out of PVS
  135. virtual void DormantBegin( void ); // called when entity becomes dormant
  136. virtual void DormantEnd( void ); // called when entity wakes from being dormant
  137. bool IsActive( void ) const;
  138. void BecomeActive( int flags );
  139. void BecomeInactive( int flags );
  140. void UpdatePVSAreas( const idVec3 &pos );
  141. // visuals
  142. virtual void Present( void );
  143. virtual renderEntity_t *GetRenderEntity( void );
  144. virtual int GetModelDefHandle( void );
  145. virtual void SetModel( const char *modelname );
  146. void SetSkin( const idDeclSkin *skin );
  147. const idDeclSkin * GetSkin( void ) const;
  148. void SetShaderParm( int parmnum, float value );
  149. virtual void SetColor( float red, float green, float blue );
  150. virtual void SetColor( const idVec3 &color );
  151. virtual void GetColor( idVec3 &out ) const;
  152. virtual void SetColor( const idVec4 &color );
  153. virtual void GetColor( idVec4 &out ) const;
  154. virtual void FreeModelDef( void );
  155. virtual void FreeLightDef( void );
  156. virtual void Hide( void );
  157. virtual void Show( void );
  158. bool IsHidden( void ) const;
  159. void UpdateVisuals( void );
  160. void UpdateModel( void );
  161. void UpdateModelTransform( void );
  162. virtual void ProjectOverlay( const idVec3 &origin, const idVec3 &dir, float size, const char *material );
  163. int GetNumPVSAreas( void );
  164. const int * GetPVSAreas( void );
  165. void ClearPVSAreas( void );
  166. bool PhysicsTeamInPVS( pvsHandle_t pvsHandle );
  167. // animation
  168. virtual bool UpdateAnimationControllers( void );
  169. bool UpdateRenderEntity( renderEntity_s *renderEntity, const renderView_t *renderView );
  170. static bool ModelCallback( renderEntity_s *renderEntity, const renderView_t *renderView );
  171. virtual idAnimator * GetAnimator( void ); // returns animator object used by this entity
  172. // sound
  173. virtual bool CanPlayChatterSounds( void ) const;
  174. bool StartSound( const char *soundName, const s_channelType channel, int soundShaderFlags, bool broadcast, int *length );
  175. bool StartSoundShader( const idSoundShader *shader, const s_channelType channel, int soundShaderFlags, bool broadcast, int *length );
  176. void StopSound( const s_channelType channel, bool broadcast ); // pass SND_CHANNEL_ANY to stop all sounds
  177. void SetSoundVolume( float volume );
  178. void UpdateSound( void );
  179. int GetListenerId( void ) const;
  180. idSoundEmitter * GetSoundEmitter( void ) const;
  181. void FreeSoundEmitter( bool immediate );
  182. // entity binding
  183. virtual void PreBind( void );
  184. virtual void PostBind( void );
  185. virtual void PreUnbind( void );
  186. virtual void PostUnbind( void );
  187. void JoinTeam( idEntity *teammember );
  188. void Bind( idEntity *master, bool orientated );
  189. void BindToJoint( idEntity *master, const char *jointname, bool orientated );
  190. void BindToJoint( idEntity *master, jointHandle_t jointnum, bool orientated );
  191. void BindToBody( idEntity *master, int bodyId, bool orientated );
  192. void Unbind( void );
  193. bool IsBound( void ) const;
  194. bool IsBoundTo( idEntity *master ) const;
  195. idEntity * GetBindMaster( void ) const;
  196. jointHandle_t GetBindJoint( void ) const;
  197. int GetBindBody( void ) const;
  198. idEntity * GetTeamMaster( void ) const;
  199. idEntity * GetNextTeamEntity( void ) const;
  200. void ConvertLocalToWorldTransform( idVec3 &offset, idMat3 &axis );
  201. idVec3 GetLocalVector( const idVec3 &vec ) const;
  202. idVec3 GetLocalCoordinates( const idVec3 &vec ) const;
  203. idVec3 GetWorldVector( const idVec3 &vec ) const;
  204. idVec3 GetWorldCoordinates( const idVec3 &vec ) const;
  205. bool GetMasterPosition( idVec3 &masterOrigin, idMat3 &masterAxis ) const;
  206. void GetWorldVelocities( idVec3 &linearVelocity, idVec3 &angularVelocity ) const;
  207. // physics
  208. // set a new physics object to be used by this entity
  209. void SetPhysics( idPhysics *phys );
  210. // get the physics object used by this entity
  211. idPhysics * GetPhysics( void ) const;
  212. // restore physics pointer for save games
  213. void RestorePhysics( idPhysics *phys );
  214. // run the physics for this entity
  215. bool RunPhysics( void );
  216. // set the origin of the physics object (relative to bindMaster if not NULL)
  217. void SetOrigin( const idVec3 &org );
  218. // set the axis of the physics object (relative to bindMaster if not NULL)
  219. void SetAxis( const idMat3 &axis );
  220. // use angles to set the axis of the physics object (relative to bindMaster if not NULL)
  221. void SetAngles( const idAngles &ang );
  222. // get the floor position underneath the physics object
  223. bool GetFloorPos( float max_dist, idVec3 &floorpos ) const;
  224. // retrieves the transformation going from the physics origin/axis to the visual origin/axis
  225. virtual bool GetPhysicsToVisualTransform( idVec3 &origin, idMat3 &axis );
  226. // retrieves the transformation going from the physics origin/axis to the sound origin/axis
  227. virtual bool GetPhysicsToSoundTransform( idVec3 &origin, idMat3 &axis );
  228. // called from the physics object when colliding, should return true if the physics simulation should stop
  229. virtual bool Collide( const trace_t &collision, const idVec3 &velocity );
  230. // retrieves impact information, 'ent' is the entity retrieving the info
  231. virtual void GetImpactInfo( idEntity *ent, int id, const idVec3 &point, impactInfo_t *info );
  232. // apply an impulse to the physics object, 'ent' is the entity applying the impulse
  233. virtual void ApplyImpulse( idEntity *ent, int id, const idVec3 &point, const idVec3 &impulse );
  234. // add a force to the physics object, 'ent' is the entity adding the force
  235. virtual void AddForce( idEntity *ent, int id, const idVec3 &point, const idVec3 &force );
  236. // activate the physics object, 'ent' is the entity activating this entity
  237. virtual void ActivatePhysics( idEntity *ent );
  238. // returns true if the physics object is at rest
  239. virtual bool IsAtRest( void ) const;
  240. // returns the time the physics object came to rest
  241. virtual int GetRestStartTime( void ) const;
  242. // add a contact entity
  243. virtual void AddContactEntity( idEntity *ent );
  244. // remove a touching entity
  245. virtual void RemoveContactEntity( idEntity *ent );
  246. // damage
  247. // returns true if this entity can be damaged from the given origin
  248. virtual bool CanDamage( const idVec3 &origin, idVec3 &damagePoint ) const;
  249. // applies damage to this entity
  250. virtual void Damage( idEntity *inflictor, idEntity *attacker, const idVec3 &dir, const char *damageDefName, const float damageScale, const int location );
  251. // adds a damage effect like overlays, blood, sparks, debris etc.
  252. virtual void AddDamageEffect( const trace_t &collision, const idVec3 &velocity, const char *damageDefName );
  253. // callback function for when another entity received damage from this entity. damage can be adjusted and returned to the caller.
  254. virtual void DamageFeedback( idEntity *victim, idEntity *inflictor, int &damage );
  255. // notifies this entity that it is in pain
  256. virtual bool Pain( idEntity *inflictor, idEntity *attacker, int damage, const idVec3 &dir, int location );
  257. // notifies this entity that is has been killed
  258. virtual void Killed( idEntity *inflictor, idEntity *attacker, int damage, const idVec3 &dir, int location );
  259. // scripting
  260. virtual bool ShouldConstructScriptObjectAtSpawn( void ) const;
  261. virtual idThread * ConstructScriptObject( void );
  262. virtual void DeconstructScriptObject( void );
  263. void SetSignal( signalNum_t signalnum, idThread *thread, const function_t *function );
  264. void ClearSignal( idThread *thread, signalNum_t signalnum );
  265. void ClearSignalThread( signalNum_t signalnum, idThread *thread );
  266. bool HasSignal( signalNum_t signalnum ) const;
  267. void Signal( signalNum_t signalnum );
  268. void SignalEvent( idThread *thread, signalNum_t signalnum );
  269. // gui
  270. void TriggerGuis( void );
  271. bool HandleGuiCommands( idEntity *entityGui, const char *cmds );
  272. virtual bool HandleSingleGuiCommand( idEntity *entityGui, idLexer *src );
  273. // targets
  274. void FindTargets( void );
  275. void RemoveNullTargets( void );
  276. void ActivateTargets( idEntity *activator ) const;
  277. // misc
  278. virtual void Teleport( const idVec3 &origin, const idAngles &angles, idEntity *destination );
  279. bool TouchTriggers( void ) const;
  280. idCurve_Spline<idVec3> *GetSpline( void ) const;
  281. virtual void ShowEditingDialog( void );
  282. enum {
  283. EVENT_STARTSOUNDSHADER,
  284. EVENT_STOPSOUNDSHADER,
  285. EVENT_MAXEVENTS
  286. };
  287. virtual void ClientPredictionThink( void );
  288. virtual void WriteToSnapshot( idBitMsgDelta &msg ) const;
  289. virtual void ReadFromSnapshot( const idBitMsgDelta &msg );
  290. virtual bool ServerReceiveEvent( int event, int time, const idBitMsg &msg );
  291. virtual bool ClientReceiveEvent( int event, int time, const idBitMsg &msg );
  292. void WriteBindToSnapshot( idBitMsgDelta &msg ) const;
  293. void ReadBindFromSnapshot( const idBitMsgDelta &msg );
  294. void WriteColorToSnapshot( idBitMsgDelta &msg ) const;
  295. void ReadColorFromSnapshot( const idBitMsgDelta &msg );
  296. void WriteGUIToSnapshot( idBitMsgDelta &msg ) const;
  297. void ReadGUIFromSnapshot( const idBitMsgDelta &msg );
  298. void ServerSendEvent( int eventId, const idBitMsg *msg, bool saveEvent, int excludeClient ) const;
  299. void ClientSendEvent( int eventId, const idBitMsg *msg ) const;
  300. protected:
  301. renderEntity_t renderEntity; // used to present a model to the renderer
  302. int modelDefHandle; // handle to static renderer model
  303. refSound_t refSound; // used to present sound to the audio engine
  304. private:
  305. idPhysics_Static defaultPhysicsObj; // default physics object
  306. idPhysics * physics; // physics used for this entity
  307. idEntity * bindMaster; // entity bound to if unequal NULL
  308. jointHandle_t bindJoint; // joint bound to if unequal INVALID_JOINT
  309. int bindBody; // body bound to if unequal -1
  310. idEntity * teamMaster; // master of the physics team
  311. idEntity * teamChain; // next entity in physics team
  312. int numPVSAreas; // number of renderer areas the entity covers
  313. int PVSAreas[MAX_PVS_AREAS]; // numbers of the renderer areas the entity covers
  314. signalList_t * signals;
  315. int mpGUIState; // local cache to avoid systematic SetStateInt
  316. private:
  317. void FixupLocalizedStrings();
  318. bool DoDormantTests( void ); // dormant == on the active list, but out of PVS
  319. // physics
  320. // initialize the default physics
  321. void InitDefaultPhysics( const idVec3 &origin, const idMat3 &axis );
  322. // update visual position from the physics
  323. void UpdateFromPhysics( bool moveBack );
  324. // entity binding
  325. bool InitBind( idEntity *master ); // initialize an entity binding
  326. void FinishBind( void ); // finish an entity binding
  327. void RemoveBinds( void ); // deletes any entities bound to this object
  328. void QuitTeam( void ); // leave the current team
  329. void UpdatePVSAreas( void );
  330. // events
  331. void Event_GetName( void );
  332. void Event_SetName( const char *name );
  333. void Event_FindTargets( void );
  334. void Event_ActivateTargets( idEntity *activator );
  335. void Event_NumTargets( void );
  336. void Event_GetTarget( float index );
  337. void Event_RandomTarget( const char *ignore );
  338. void Event_Bind( idEntity *master );
  339. void Event_BindPosition( idEntity *master );
  340. void Event_BindToJoint( idEntity *master, const char *jointname, float orientated );
  341. void Event_Unbind( void );
  342. void Event_RemoveBinds( void );
  343. void Event_SpawnBind( void );
  344. void Event_SetOwner( idEntity *owner );
  345. void Event_SetModel( const char *modelname );
  346. void Event_SetSkin( const char *skinname );
  347. void Event_GetShaderParm( int parmnum );
  348. void Event_SetShaderParm( int parmnum, float value );
  349. void Event_SetShaderParms( float parm0, float parm1, float parm2, float parm3 );
  350. void Event_SetColor( float red, float green, float blue );
  351. void Event_GetColor( void );
  352. void Event_IsHidden( void );
  353. void Event_Hide( void );
  354. void Event_Show( void );
  355. void Event_CacheSoundShader( const char *soundName );
  356. void Event_StartSoundShader( const char *soundName, int channel );
  357. void Event_StopSound( int channel, int netSync );
  358. void Event_StartSound( const char *soundName, int channel, int netSync );
  359. void Event_FadeSound( int channel, float to, float over );
  360. void Event_GetWorldOrigin( void );
  361. void Event_SetWorldOrigin( idVec3 const &org );
  362. void Event_GetOrigin( void );
  363. void Event_SetOrigin( const idVec3 &org );
  364. void Event_GetAngles( void );
  365. void Event_SetAngles( const idAngles &ang );
  366. void Event_SetLinearVelocity( const idVec3 &velocity );
  367. void Event_GetLinearVelocity( void );
  368. void Event_SetAngularVelocity( const idVec3 &velocity );
  369. void Event_GetAngularVelocity( void );
  370. void Event_SetSize( const idVec3 &mins, const idVec3 &maxs );
  371. void Event_GetSize( void );
  372. void Event_GetMins( void );
  373. void Event_GetMaxs( void );
  374. void Event_Touches( idEntity *ent );
  375. void Event_SetGuiParm( const char *key, const char *val );
  376. void Event_SetGuiFloat( const char *key, float f );
  377. void Event_GetNextKey( const char *prefix, const char *lastMatch );
  378. void Event_SetKey( const char *key, const char *value );
  379. void Event_GetKey( const char *key );
  380. void Event_GetIntKey( const char *key );
  381. void Event_GetFloatKey( const char *key );
  382. void Event_GetVectorKey( const char *key );
  383. void Event_GetEntityKey( const char *key );
  384. void Event_RestorePosition( void );
  385. void Event_UpdateCameraTarget( void );
  386. void Event_DistanceTo( idEntity *ent );
  387. void Event_DistanceToPoint( const idVec3 &point );
  388. void Event_StartFx( const char *fx );
  389. void Event_WaitFrame( void );
  390. void Event_Wait( float time );
  391. void Event_HasFunction( const char *name );
  392. void Event_CallFunction( const char *name );
  393. void Event_SetNeverDormant( int enable );
  394. };
  395. /*
  396. ===============================================================================
  397. Animated entity base class.
  398. ===============================================================================
  399. */
  400. typedef struct damageEffect_s {
  401. jointHandle_t jointNum;
  402. idVec3 localOrigin;
  403. idVec3 localNormal;
  404. int time;
  405. const idDeclParticle* type;
  406. struct damageEffect_s * next;
  407. } damageEffect_t;
  408. class idAnimatedEntity : public idEntity {
  409. public:
  410. CLASS_PROTOTYPE( idAnimatedEntity );
  411. idAnimatedEntity();
  412. ~idAnimatedEntity();
  413. void Save( idSaveGame *savefile ) const;
  414. void Restore( idRestoreGame *savefile );
  415. virtual void ClientPredictionThink( void );
  416. virtual void Think( void );
  417. void UpdateAnimation( void );
  418. virtual idAnimator * GetAnimator( void );
  419. virtual void SetModel( const char *modelname );
  420. bool GetJointWorldTransform( jointHandle_t jointHandle, int currentTime, idVec3 &offset, idMat3 &axis );
  421. bool GetJointTransformForAnim( jointHandle_t jointHandle, int animNum, int currentTime, idVec3 &offset, idMat3 &axis ) const;
  422. virtual int GetDefaultSurfaceType( void ) const;
  423. virtual void AddDamageEffect( const trace_t &collision, const idVec3 &velocity, const char *damageDefName );
  424. void AddLocalDamageEffect( jointHandle_t jointNum, const idVec3 &localPoint, const idVec3 &localNormal, const idVec3 &localDir, const idDeclEntityDef *def, const idMaterial *collisionMaterial );
  425. void UpdateDamageEffects( void );
  426. virtual bool ClientReceiveEvent( int event, int time, const idBitMsg &msg );
  427. enum {
  428. EVENT_ADD_DAMAGE_EFFECT = idEntity::EVENT_MAXEVENTS,
  429. EVENT_MAXEVENTS
  430. };
  431. protected:
  432. idAnimator animator;
  433. damageEffect_t * damageEffects;
  434. private:
  435. void Event_GetJointHandle( const char *jointname );
  436. void Event_ClearAllJoints( void );
  437. void Event_ClearJoint( jointHandle_t jointnum );
  438. void Event_SetJointPos( jointHandle_t jointnum, jointModTransform_t transform_type, const idVec3 &pos );
  439. void Event_SetJointAngle( jointHandle_t jointnum, jointModTransform_t transform_type, const idAngles &angles );
  440. void Event_GetJointPos( jointHandle_t jointnum );
  441. void Event_GetJointAngle( jointHandle_t jointnum );
  442. };
  443. #endif /* !__GAME_ENTITY_H__ */