doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Anim.h
Go to the documentation of this file.
1 /*
2 ===========================================================================
3 
4 Doom 3 GPL Source Code
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
6 
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
8 
9 Doom 3 Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13 
14 Doom 3 Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
21 
22 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.
23 
24 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.
25 
26 ===========================================================================
27 */
28 #ifndef __ANIM_H__
29 #define __ANIM_H__
30 
31 //
32 // animation channels
33 // these can be changed by modmakers and licensees to be whatever they need.
34 const int ANIM_NumAnimChannels = 5;
36 const int ANIM_MaxSyncedAnims = 3;
37 
38 //
39 // animation channels. make sure to change script/doom_defs.script if you add any channels, or change their order
40 //
41 const int ANIMCHANNEL_ALL = 0;
42 const int ANIMCHANNEL_TORSO = 1;
43 const int ANIMCHANNEL_LEGS = 2;
44 const int ANIMCHANNEL_HEAD = 3;
45 const int ANIMCHANNEL_EYELIDS = 4;
46 
47 // for converting from 24 frames per second to milliseconds
48 ID_INLINE int FRAME2MS( int framenum ) {
49  return ( framenum * 1000 ) / 24;
50 }
51 
52 class idRenderModel;
53 class idAnimator;
54 class idAnimBlend;
55 class function_t;
56 class idEntity;
57 class idSaveGame;
58 class idRestoreGame;
59 
60 typedef struct {
61  int cycleCount; // how many times the anim has wrapped to the begining (0 for clamped anims)
62  int frame1;
63  int frame2;
64  float frontlerp;
65  float backlerp;
66 } frameBlend_t;
67 
68 typedef struct {
69  int nameIndex;
70  int parentNum;
71  int animBits;
74 
75 typedef struct {
78  int channel;
79 } jointInfo_t;
80 
81 //
82 // joint modifier modes. make sure to change script/doom_defs.script if you add any, or change their order.
83 //
84 typedef enum {
85  JOINTMOD_NONE, // no modification
86  JOINTMOD_LOCAL, // modifies the joint's position or orientation in joint local space
87  JOINTMOD_LOCAL_OVERRIDE, // sets the joint's position or orientation in joint local space
88  JOINTMOD_WORLD, // modifies joint's position or orientation in model space
89  JOINTMOD_WORLD_OVERRIDE // sets the joint's position or orientation in model space
91 
92 typedef struct {
98 } jointMod_t;
99 
100 #define ANIM_TX BIT( 0 )
101 #define ANIM_TY BIT( 1 )
102 #define ANIM_TZ BIT( 2 )
103 #define ANIM_QX BIT( 3 )
104 #define ANIM_QY BIT( 4 )
105 #define ANIM_QZ BIT( 5 )
106 
107 typedef enum {
149 #ifdef _D3XP
150  , FC_LAUNCH_PROJECTILE,
151  FC_TRIGGER_FX,
152  FC_START_EMITTER,
153  FC_STOP_EMITTER,
154 #endif
156 
157 typedef struct {
158  int num;
160 } frameLookup_t;
161 
162 typedef struct {
165 
166  union {
168  const function_t *function;
169  const idDeclSkin *skin;
170  int index;
171  };
173 
174 typedef struct {
175  bool prevent_idle_override : 1;
176  bool random_cycle_start : 1;
177  bool ai_no_turn : 1;
178  bool anim_turn : 1;
179 } animFlags_t;
180 
181 
182 /*
183 ==============================================================================================
184 
185  idModelExport
186 
187 ==============================================================================================
188 */
189 
191 private:
192  void Reset( void );
193  bool ParseOptions( idLexer &lex );
194  int ParseExportSection( idParser &parser );
195 
196  static bool CheckMayaInstall( void );
197  static void LoadMayaDll( void );
198 
199  bool ConvertMayaToMD5( void );
200  static bool initialized;
201 
202 public:
206  bool force;
207 
208  idModelExport();
209 
210  static void Shutdown( void );
211 
212  int ExportDefFile( const char *filename );
213  bool ExportModel( const char *model );
214  bool ExportAnim( const char *anim );
215  int ExportModels( const char *pathname, const char *extension );
216 };
217 
218 /*
219 ==============================================================================================
220 
221  idMD5Anim
222 
223 ==============================================================================================
224 */
225 
226 class idMD5Anim {
227 private:
239  mutable int ref_count;
240 
241 public:
242  idMD5Anim();
243  ~idMD5Anim();
244 
245  void Free( void );
246  bool Reload( void );
247  size_t Allocated( void ) const;
248  size_t Size( void ) const { return sizeof( *this ) + Allocated(); };
249  bool LoadAnim( const char *filename );
250 
251  void IncreaseRefs( void ) const;
252  void DecreaseRefs( void ) const;
253  int NumRefs( void ) const;
254 
255  void CheckModelHierarchy( const idRenderModel *model ) const;
256  void GetInterpolatedFrame( frameBlend_t &frame, idJointQuat *joints, const int *index, int numIndexes ) const;
257  void GetSingleFrame( int framenum, idJointQuat *joints, const int *index, int numIndexes ) const;
258  int Length( void ) const;
259  int NumFrames( void ) const;
260  int NumJoints( void ) const;
261  const idVec3 &TotalMovementDelta( void ) const;
262  const char *Name( void ) const;
263 
264  void GetFrameBlend( int framenum, frameBlend_t &frame ) const; // frame 1 is first frame
265  void ConvertTimeToFrame( int time, int cyclecount, frameBlend_t &frame ) const;
266 
267  void GetOrigin( idVec3 &offset, int currentTime, int cyclecount ) const;
268  void GetOriginRotation( idQuat &rotation, int time, int cyclecount ) const;
269  void GetBounds( idBounds &bounds, int currentTime, int cyclecount ) const;
270 };
271 
272 /*
273 ==============================================================================================
274 
275  idAnim
276 
277 ==============================================================================================
278 */
279 
280 class idAnim {
281 private:
282  const class idDeclModelDef *modelDef;
284  int numAnims;
290 
291 public:
292  idAnim();
293  idAnim( const idDeclModelDef *modelDef, const idAnim *anim );
294  ~idAnim();
295 
296  void SetAnim( const idDeclModelDef *modelDef, const char *sourcename, const char *animname, int num, const idMD5Anim *md5anims[ ANIM_MaxSyncedAnims ] );
297  const char *Name( void ) const;
298  const char *FullName( void ) const;
299  const idMD5Anim *MD5Anim( int num ) const;
300  const idDeclModelDef *ModelDef( void ) const;
301  int Length( void ) const;
302  int NumFrames( void ) const;
303  int NumAnims( void ) const;
304  const idVec3 &TotalMovementDelta( void ) const;
305  bool GetOrigin( idVec3 &offset, int animNum, int time, int cyclecount ) const;
306  bool GetOriginRotation( idQuat &rotation, int animNum, int currentTime, int cyclecount ) const;
307  bool GetBounds( idBounds &bounds, int animNum, int time, int cyclecount ) const;
308  const char *AddFrameCommand( const class idDeclModelDef *modelDef, int framenum, idLexer &src, const idDict *def );
309  void CallFrameCommands( idEntity *ent, int from, int to ) const;
310  bool HasFrameCommands( void ) const;
311 
312  // returns first frame (zero based) that command occurs. returns -1 if not found.
313  int FindFrameForFrameCommand( frameCommandType_t framecommand, const frameCommand_t **command ) const;
314  void SetAnimFlags( const animFlags_t &animflags );
315  const animFlags_t &GetAnimFlags( void ) const;
316 };
317 
318 /*
319 ==============================================================================================
320 
321  idDeclModelDef
322 
323 ==============================================================================================
324 */
325 
326 class idDeclModelDef : public idDecl {
327 public:
328  idDeclModelDef();
329  ~idDeclModelDef();
330 
331  virtual size_t Size( void ) const;
332  virtual const char * DefaultDefinition( void ) const;
333  virtual bool Parse( const char *text, const int textLength );
334  virtual void FreeData( void );
335 
336  void Touch( void ) const;
337 
338  const idDeclSkin * GetDefaultSkin( void ) const;
339  const idJointQuat * GetDefaultPose( void ) const;
340  void SetupJoints( int *numJoints, idJointMat **jointList, idBounds &frameBounds, bool removeOriginOffset ) const;
341  idRenderModel * ModelHandle( void ) const;
342  void GetJointList( const char *jointnames, idList<jointHandle_t> &jointList ) const;
343  const jointInfo_t * FindJoint( const char *name ) const;
344 
345  int NumAnims( void ) const;
346  const idAnim * GetAnim( int index ) const;
347  int GetSpecificAnim( const char *name ) const;
348  int GetAnim( const char *name ) const;
349  bool HasAnim( const char *name ) const;
350  const idDeclSkin * GetSkin( void ) const;
351  const char * GetModelName( void ) const;
352  const idList<jointInfo_t> & Joints( void ) const;
353  const int * JointParents( void ) const;
354  int NumJoints( void ) const;
355  const jointInfo_t * GetJoint( int jointHandle ) const;
356  const char * GetJointName( int jointHandle ) const;
357  int NumJointsOnChannel( int channel ) const;
358  const int * GetChannelJoints( int channel ) const;
359 
360  const idVec3 & GetVisualOffset( void ) const;
361 
362 private:
363  void CopyDecl( const idDeclModelDef *decl );
364  bool ParseAnim( idLexer &src, int numDefaultAnims );
365 
366 private:
373  const idDeclSkin * skin;
374 };
375 
376 /*
377 ==============================================================================================
378 
379  idAnimBlend
380 
381 ==============================================================================================
382 */
383 
384 class idAnimBlend {
385 private:
386  const class idDeclModelDef *modelDef;
388  int endtime;
390  float rate;
391 
396 
398  short cycle;
399  short frame;
400  short animNum;
401  bool allowMove;
403 
404  friend class idAnimator;
405 
406  void Reset( const idDeclModelDef *_modelDef );
407  void CallFrameCommands( idEntity *ent, int fromtime, int totime ) const;
408  void SetFrame( const idDeclModelDef *modelDef, int animnum, int frame, int currenttime, int blendtime );
409  void CycleAnim( const idDeclModelDef *modelDef, int animnum, int currenttime, int blendtime );
410  void PlayAnim( const idDeclModelDef *modelDef, int animnum, int currenttime, int blendtime );
411  bool BlendAnim( int currentTime, int channel, int numJoints, idJointQuat *blendFrame, float &blendWeight, bool removeOrigin, bool overrideBlend, bool printInfo ) const;
412  void BlendOrigin( int currentTime, idVec3 &blendPos, float &blendWeight, bool removeOriginOffset ) const;
413  void BlendDelta( int fromtime, int totime, idVec3 &blendDelta, float &blendWeight ) const;
414  void BlendDeltaRotation( int fromtime, int totime, idQuat &blendDelta, float &blendWeight ) const;
415  bool AddBounds( int currentTime, idBounds &bounds, bool removeOriginOffset ) const;
416 
417 public:
418  idAnimBlend();
419  void Save( idSaveGame *savefile ) const;
420  void Restore( idRestoreGame *savefile, const idDeclModelDef *modelDef );
421  const char *AnimName( void ) const;
422  const char *AnimFullName( void ) const;
423  float GetWeight( int currenttime ) const;
424  float GetFinalWeight( void ) const;
425  void SetWeight( float newweight, int currenttime, int blendtime );
426  int NumSyncedAnims( void ) const;
427  bool SetSyncedAnimWeight( int num, float weight );
428  void Clear( int currentTime, int clearTime );
429  bool IsDone( int currentTime ) const;
430  bool FrameHasChanged( int currentTime ) const;
431  int GetCycleCount( void ) const;
432  void SetCycleCount( int count );
433  void SetPlaybackRate( int currentTime, float newRate );
434  float GetPlaybackRate( void ) const;
435  void SetStartTime( int startTime );
436  int GetStartTime( void ) const;
437  int GetEndTime( void ) const;
438  int GetFrameNumber( int currenttime ) const;
439  int AnimTime( int currenttime ) const;
440  int NumFrames( void ) const;
441  int Length( void ) const;
442  int PlayLength( void ) const;
443  void AllowMovement( bool allow );
444  void AllowFrameCommands( bool allow );
445  const idAnim *Anim( void ) const;
446  int AnimNum( void ) const;
447 };
448 
449 /*
450 ==============================================================================================
451 
452  idAFPoseJointMod
453 
454 ==============================================================================================
455 */
456 
457 typedef enum {
462 
464 public:
465  idAFPoseJointMod( void );
466 
470 };
471 
474  axis.Identity();
475  origin.Zero();
476 }
477 
478 /*
479 ==============================================================================================
480 
481  idAnimator
482 
483 ==============================================================================================
484 */
485 
486 class idAnimator {
487 public:
488  idAnimator();
489  ~idAnimator();
490 
491  size_t Allocated( void ) const;
492  size_t Size( void ) const;
493 
494  void Save( idSaveGame *savefile ) const; // archives object for save game file
495  void Restore( idRestoreGame *savefile ); // unarchives object from save game file
496 
497  void SetEntity( idEntity *ent );
498  idEntity *GetEntity( void ) const ;
499  void RemoveOriginOffset( bool remove );
500  bool RemoveOrigin( void ) const;
501 
502  void GetJointList( const char *jointnames, idList<jointHandle_t> &jointList ) const;
503 
504  int NumAnims( void ) const;
505  const idAnim *GetAnim( int index ) const;
506  int GetAnim( const char *name ) const;
507  bool HasAnim( const char *name ) const;
508 
509  void ServiceAnims( int fromtime, int totime );
510  bool IsAnimating( int currentTime ) const;
511 
512  void GetJoints( int *numJoints, idJointMat **jointsPtr );
513  int NumJoints( void ) const;
514  jointHandle_t GetFirstChild( jointHandle_t jointnum ) const;
515  jointHandle_t GetFirstChild( const char *name ) const;
516 
517  idRenderModel *SetModel( const char *modelname );
518  idRenderModel *ModelHandle( void ) const;
519  const idDeclModelDef *ModelDef( void ) const;
520 
521  void ForceUpdate( void );
522  void ClearForceUpdate( void );
523  bool CreateFrame( int animtime, bool force );
524  bool FrameHasChanged( int animtime ) const;
525  void GetDelta( int fromtime, int totime, idVec3 &delta ) const;
526  bool GetDeltaRotation( int fromtime, int totime, idMat3 &delta ) const;
527  void GetOrigin( int currentTime, idVec3 &pos ) const;
528  bool GetBounds( int currentTime, idBounds &bounds );
529 
530  idAnimBlend *CurrentAnim( int channelNum );
531  void Clear( int channelNum, int currentTime, int cleartime );
532  void SetFrame( int channelNum, int animnum, int frame, int currenttime, int blendtime );
533  void CycleAnim( int channelNum, int animnum, int currenttime, int blendtime );
534  void PlayAnim( int channelNum, int animnum, int currenttime, int blendTime );
535 
536  // copies the current anim from fromChannelNum to channelNum.
537  // the copied anim will have frame commands disabled to avoid executing them twice.
538  void SyncAnimChannels( int channelNum, int fromChannelNum, int currenttime, int blendTime );
539 
540  void SetJointPos( jointHandle_t jointnum, jointModTransform_t transform_type, const idVec3 &pos );
541  void SetJointAxis( jointHandle_t jointnum, jointModTransform_t transform_type, const idMat3 &mat );
542  void ClearJoint( jointHandle_t jointnum );
543  void ClearAllJoints( void );
544 
545  void InitAFPose( void );
546  void SetAFPoseJointMod( const jointHandle_t jointNum, const AFJointModType_t mod, const idMat3 &axis, const idVec3 &origin );
547  void FinishAFPose( int animnum, const idBounds &bounds, const int time );
548  void SetAFPoseBlendWeight( float blendWeight );
549  bool BlendAFPose( idJointQuat *blendFrame ) const;
550  void ClearAFPose( void );
551 
552  void ClearAllAnims( int currentTime, int cleartime );
553 
554  jointHandle_t GetJointHandle( const char *name ) const;
555  const char * GetJointName( jointHandle_t handle ) const;
556  int GetChannelForJoint( jointHandle_t joint ) const;
557  bool GetJointTransform( jointHandle_t jointHandle, int currenttime, idVec3 &offset, idMat3 &axis );
558  bool GetJointLocalTransform( jointHandle_t jointHandle, int currentTime, idVec3 &offset, idMat3 &axis );
559 
560  const animFlags_t GetAnimFlags( int animnum ) const;
561  int NumFrames( int animnum ) const;
562  int NumSyncedAnims( int animnum ) const;
563  const char *AnimName( int animnum ) const;
564  const char *AnimFullName( int animnum ) const;
565  int AnimLength( int animnum ) const;
566  const idVec3 &TotalMovementDelta( int animnum ) const;
567 
568 private:
569  void FreeData( void );
570  void PushAnims( int channel, int currentTime, int blendTime );
571 
572 private:
575 
580 
581  mutable int lastTransformTime; // mutable because the value is updated in CreateFrame
585 
587 
594 };
595 
596 /*
597 ==============================================================================================
598 
599  idAnimManager
600 
601 ==============================================================================================
602 */
603 
605 public:
606  idAnimManager();
607  ~idAnimManager();
608 
609  static bool forceExport;
610 
611  void Shutdown( void );
612  idMD5Anim * GetAnim( const char *name );
613  void ReloadAnims( void );
614  void ListAnims( void ) const;
615  int JointIndex( const char *name );
616  const char * JointName( int index ) const;
617 
618  void ClearAnimsInUse( void );
619  void FlushUnusedAnims( void );
620 
621 private:
625 };
626 
627 #endif /* !__ANIM_H__ */
int JointIndex(const char *name)
Definition: Anim.cpp:1004
jointHandle_t
Definition: Model.h:156
Definition: Anim.h:111
int NumJoints(void) const
bool ParseAnim(idLexer &src, int numDefaultAnims)
int GetChannelForJoint(jointHandle_t joint) const
bool GetJointTransform(jointHandle_t jointHandle, int currenttime, idVec3 &offset, idMat3 &axis)
int timeOffset
Definition: Anim.h:389
bool GetBounds(int currentTime, idBounds &bounds)
void SetCycleCount(int count)
int animLength
Definition: Anim.h:230
void Save(idSaveGame *savefile) const
int nameIndex
Definition: Anim.h:69
float blendEndValue
Definition: Anim.h:395
void SyncAnimChannels(int channelNum, int fromChannelNum, int currenttime, int blendTime)
bool IsAnimating(int currentTime) const
jointHandle_t GetFirstChild(jointHandle_t jointnum) const
int firstCommand
Definition: Anim.h:159
void FinishAFPose(int animnum, const idBounds &bounds, const int time)
void SetAnimFlags(const animFlags_t &animflags)
int channel
Definition: Anim.h:78
int Length(void) const
Definition: Anim_Blend.cpp:186
AFJointModType_t
Definition: Anim.h:457
virtual bool Parse(const char *text, const int textLength)
const int * JointParents(void) const
const jointInfo_t * FindJoint(const char *name) const
void ListAnims(void) const
Definition: Anim.cpp:1033
int NumAnims(void) const
void Clear(int currentTime, int clearTime)
idRenderModel * modelHandle
Definition: Anim.h:371
bool force
Definition: Anim.h:206
const idVec3 & TotalMovementDelta(void) const
Definition: Anim_Blend.cpp:221
void SetFrame(const idDeclModelDef *modelDef, int animnum, int frame, int currenttime, int blendtime)
int animBits
Definition: Anim.h:71
virtual size_t Size(void) const
bool SetSyncedAnimWeight(int num, float weight)
idRenderModel * ModelHandle(void) const
short frame
Definition: Anim.h:399
const int ANIMCHANNEL_ALL
Definition: Anim.h:41
int NumJoints(void) const
void GetBounds(idBounds &bounds, int currentTime, int cyclecount) const
Definition: Anim.cpp:589
const int ANIM_MaxSyncedAnims
Definition: Anim.h:36
int AFPoseTime
Definition: Anim.h:593
bool AddBounds(int currentTime, idBounds &bounds, bool removeOriginOffset) const
float GetWeight(int currenttime) const
void AllowFrameCommands(bool allow)
int AnimTime(int currenttime) const
virtual void FreeData(void)
float blendStartValue
Definition: Anim.h:394
const int ANIMCHANNEL_EYELIDS
Definition: Anim.h:45
void PlayAnim(int channelNum, int animnum, int currenttime, int blendTime)
float GetPlaybackRate(void) const
idHashIndex jointnamesHash
Definition: Anim.h:624
int numFrames
Definition: Anim.h:228
bool CreateFrame(int animtime, bool force)
int FindFrameForFrameCommand(frameCommandType_t framecommand, const frameCommand_t **command) const
const idDeclSkin * skin
Definition: Anim.h:169
jointHandle_t GetJointHandle(const char *name) const
const idDeclSkin * skin
Definition: Anim.h:373
idBounds frameBounds
Definition: Anim.h:586
int NumSyncedAnims(int animnum) const
const class idDeclModelDef * modelDef
Definition: Anim.h:386
Definition: Vector.h:316
Definition: Anim.h:140
void BlendDelta(int fromtime, int totime, idVec3 &blendDelta, float &blendWeight) const
const char * AnimName(int animnum) const
bool ExportAnim(const char *anim)
idStr name
Definition: Anim.h:285
bool FrameHasChanged(int currentTime) const
idList< idAnim * > anims
Definition: Anim.h:372
void InitAFPose(void)
const idDeclSkin * GetSkin(void) const
void GetOrigin(int currentTime, idVec3 &pos) const
void SetJointPos(jointHandle_t jointnum, jointModTransform_t transform_type, const idVec3 &pos)
idList< idBounds > bounds
Definition: Anim.h:233
void GetOrigin(idVec3 &offset, int currentTime, int cyclecount) const
Definition: Anim.cpp:434
int frame1
Definition: Anim.h:62
int NumJointsOnChannel(int channel) const
idVec3 offset
Definition: Anim.h:367
GLuint src
Definition: glext.h:5390
const idDeclModelDef * modelDef
Definition: Anim.h:573
idStr commandLine
Definition: Anim.h:203
const int ANIMCHANNEL_HEAD
Definition: Anim.h:44
void Identity(void)
Definition: Matrix.h:591
bool BlendAnim(int currentTime, int channel, int numJoints, idJointQuat *blendFrame, float &blendWeight, bool removeOrigin, bool overrideBlend, bool printInfo) const
void IncreaseRefs(void) const
Definition: Anim.cpp:335
idAFPoseJointMod(void)
Definition: Anim.h:472
bool HasFrameCommands(void) const
void CheckModelHierarchy(const idRenderModel *model) const
Definition: Anim.cpp:888
void SetStartTime(int startTime)
const idVec3 & TotalMovementDelta(int animnum) const
const char * GetJointName(int jointHandle) const
GLintptr offset
Definition: glext.h:3113
int index
Definition: Anim.h:170
void SetAnim(const idDeclModelDef *modelDef, const char *sourcename, const char *animname, int num, const idMD5Anim *md5anims[ANIM_MaxSyncedAnims])
Definition: Anim_Blend.cpp:110
~idMD5Anim()
Definition: Anim.cpp:61
bool FrameHasChanged(int animtime) const
GLuint GLuint num
Definition: glext.h:5390
void Restore(idRestoreGame *savefile)
idList< int > channelJoints[ANIM_NumAnimChannels]
Definition: Anim.h:370
bool stoppedAnimatingUpdate
Definition: Anim.h:582
int ref_count
Definition: Anim.h:239
const jointInfo_t * GetJoint(int jointHandle) const
void Reset(const idDeclModelDef *_modelDef)
idVec3 origin
Definition: Anim.h:469
int cycleCount
Definition: Anim.h:61
int blendDuration
Definition: Anim.h:393
idList< int > AFPoseJoints
Definition: Anim.h:589
bool GetBounds(idBounds &bounds, int animNum, int time, int cyclecount) const
Definition: Anim_Blend.cpp:264
idBounds AFPoseBounds
Definition: Anim.h:592
animFlags_t flags
Definition: Anim.h:289
void SetJointAxis(jointHandle_t jointnum, jointModTransform_t transform_type, const idMat3 &mat)
~idAnimManager()
Definition: Anim.cpp:933
void Shutdown(void)
Definition: Anim.cpp:942
idAnimManager()
Definition: Anim.cpp:925
bool ParseOptions(idLexer &lex)
void Free(void)
Definition: Anim.cpp:70
int AnimNum(void) const
const char * AnimName(void) const
idList< frameCommand_t > frameCommands
Definition: Anim.h:288
void ClearAllJoints(void)
const char * AnimFullName(void) const
idList< float > componentFrames
Definition: Anim.h:236
int GetFrameNumber(int currenttime) const
Definition: Lexer.h:137
idRenderModel * SetModel(const char *modelname)
void GetDelta(int fromtime, int totime, idVec3 &delta) const
int endtime
Definition: Anim.h:388
GLuint GLuint GLsizei count
Definition: glext.h:2845
int ExportDefFile(const char *filename)
jointModTransform_t
Definition: Anim.h:84
void RemoveOriginOffset(bool remove)
int blendStartTime
Definition: Anim.h:392
int PlayLength(void) const
const int ANIM_MaxAnimsPerChannel
Definition: Anim.h:35
idMD5Anim()
Definition: Anim.cpp:47
idMD5Anim * GetAnim(const char *name)
Definition: Anim.cpp:953
GLuint index
Definition: glext.h:3476
int Length(void) const
Definition: Anim.cpp:107
int numJoints
Definition: Anim.h:231
int NumRefs(void) const
Definition: Anim.cpp:353
void SetupJoints(int *numJoints, idJointMat **jointList, idBounds &frameBounds, bool removeOriginOffset) const
const idList< jointInfo_t > & Joints(void) const
const animFlags_t & GetAnimFlags(void) const
frameCommandType_t type
Definition: Anim.h:163
static bool forceExport
Definition: Anim.h:609
idMat3 axis
Definition: Anim.h:468
int Length(void) const
void ClearAllAnims(int currentTime, int cleartime)
Definition: Dict.h:65
const idMD5Anim * MD5Anim(int num) const
Definition: Anim_Blend.cpp:165
float frontlerp
Definition: Anim.h:64
idAnimBlend * CurrentAnim(int channelNum)
bool GetJointLocalTransform(jointHandle_t jointHandle, int currentTime, idVec3 &offset, idMat3 &axis)
jointHandle_t num
Definition: Anim.h:76
void GetFrameBlend(int framenum, frameBlend_t &frame) const
Definition: Anim.cpp:362
const idAnim * GetAnim(int index) const
int NumAnims(void) const
Definition: Anim_Blend.cpp:212
idList< jointMod_t * > jointMods
Definition: Anim.h:577
void CycleAnim(int channelNum, int animnum, int currenttime, int blendtime)
idList< idJointQuat > AFPoseJointFrame
Definition: Anim.h:591
const char * JointName(int index) const
Definition: Anim.cpp:1024
const int ANIM_NumAnimChannels
Definition: Anim.h:34
void GetJointList(const char *jointnames, idList< jointHandle_t > &jointList) const
void GetInterpolatedFrame(frameBlend_t &frame, idJointQuat *joints, const int *index, int numIndexes) const
Definition: Anim.cpp:630
bool GetOrigin(idVec3 &offset, int animNum, int time, int cyclecount) const
Definition: Anim_Blend.cpp:234
const char * FullName(void) const
Definition: Anim_Blend.cpp:154
Definition: Anim.h:137
bool ExportModel(const char *model)
void GetJointList(const char *jointnames, idList< jointHandle_t > &jointList) const
int NumFrames(void) const
Definition: Anim_Blend.cpp:199
const char * Name(void) const
Definition: Anim.cpp:125
idList< jointAnimInfo_t > jointInfo
Definition: Anim.h:234
float GetFinalWeight(void) const
size_t Size(void) const
Definition: Anim.h:248
void ServiceAnims(int fromtime, int totime)
const idDeclModelDef * ModelDef(void) const
void CycleAnim(const idDeclModelDef *modelDef, int animnum, int currenttime, int blendtime)
int numAnims
Definition: Anim.h:284
idHashTable< idMD5Anim * > animations
Definition: Anim.h:622
idJointMat * joints
Definition: Anim.h:579
void SetWeight(float newweight, int currenttime, int blendtime)
int ExportModels(const char *pathname, const char *extension)
void ForceUpdate(void)
int NumAnims(void) const
const animFlags_t GetAnimFlags(int animnum) const
int GetCycleCount(void) const
void PushAnims(int channel, int currentTime, int blendTime)
void GetJoints(int *numJoints, idJointMat **jointsPtr)
const idVec3 & GetVisualOffset(void) const
const char * Name(void) const
Definition: Anim_Blend.cpp:145
const idDeclSkin * GetDefaultSkin(void) const
idVec3 totaldelta
Definition: Anim.h:238
idList< idAFPoseJointMod > AFPoseJointMods
Definition: Anim.h:590
bool forceUpdate
Definition: Anim.h:584
void ClearForceUpdate(void)
void Touch(void) const
void Save(idSaveGame *savefile) const
const class idDeclModelDef * modelDef
Definition: Anim.h:282
void FlushUnusedAnims(void)
Definition: Anim.cpp:1069
const idSoundShader * soundShader
Definition: Anim.h:167
int NumJoints(void) const
Definition: Anim.cpp:98
void FreeData(void)
int lastTransformTime
Definition: Anim.h:581
const char * GetModelName(void) const
frameCommandType_t
Definition: Anim.h:107
idVec3 pos
Definition: Anim.h:95
bool IsDone(int currentTime) const
const idDeclModelDef * ModelDef(void) const
Definition: Anim_Blend.cpp:177
bool GetDeltaRotation(int fromtime, int totime, idMat3 &delta) const
idList< idJointQuat > baseFrame
Definition: Anim.h:235
idStr src
Definition: Anim.h:204
Definition: Quat.h:48
jointModTransform_t transform_pos
Definition: Anim.h:96
idStrList jointnames
Definition: Anim.h:623
jointHandle_t parentNum
Definition: Anim.h:77
int AnimLength(int animnum) const
float rate
Definition: Anim.h:390
bool HasAnim(const char *name) const
float backlerp
Definition: Anim.h:65
void ReloadAnims(void)
Definition: Anim.cpp:987
bool Reload(void)
Definition: Anim.cpp:134
idEntity * entity
Definition: Anim.h:574
Definition: Matrix.h:333
void DecreaseRefs(void) const
Definition: Anim.cpp:344
int firstComponent
Definition: Anim.h:72
int numAnimatedComponents
Definition: Anim.h:232
int ParseExportSection(idParser &parser)
virtual const char * DefaultDefinition(void) const
idStr * string
Definition: Anim.h:164
jointModTransform_t transform_axis
Definition: Anim.h:97
const char * AnimFullName(int animnum) const
void BlendDeltaRotation(int fromtime, int totime, idQuat &blendDelta, float &blendWeight) const
static void LoadMayaDll(void)
bool GetOriginRotation(idQuat &rotation, int animNum, int currentTime, int cyclecount) const
Definition: Anim_Blend.cpp:249
size_t Size(void) const
void PlayAnim(const idDeclModelDef *modelDef, int animnum, int currenttime, int blendtime)
short cycle
Definition: Anim.h:398
idAnimBlend channels[ANIM_NumAnimChannels][ANIM_MaxAnimsPerChannel]
Definition: Anim.h:576
float AFPoseBlendWeight
Definition: Anim.h:588
idList< jointInfo_t > joints
Definition: Anim.h:368
const char * AddFrameCommand(const class idDeclModelDef *modelDef, int framenum, idLexer &src, const idDict *def)
Definition: Anim_Blend.cpp:281
const GLcharARB * name
Definition: glext.h:3629
AFJointModType_t mod
Definition: Anim.h:467
idList< frameLookup_t > frameLookup
Definition: Anim.h:287
idList< int > jointParents
Definition: Anim.h:369
const idVec3 & TotalMovementDelta(void) const
Definition: Anim.cpp:116
Definition: Str.h:116
int starttime
Definition: Anim.h:387
int numJoints
Definition: Anim.h:578
bool BlendAFPose(idJointQuat *blendFrame) const
void AllowMovement(bool allow)
int parentNum
Definition: Anim.h:70
Definition: Anim.h:124
void Reset(void)
int frame2
Definition: Anim.h:63
static void Shutdown(void)
Definition: Anim_Import.cpp:63
int frameRate
Definition: Anim.h:229
void CallFrameCommands(idEntity *ent, int fromtime, int totime) const
void SetAFPoseBlendWeight(float blendWeight)
void Clear(int channelNum, int currentTime, int cleartime)
int NumFrames(int animnum) const
const idAnim * GetAnim(int index) const
void ClearAFPose(void)
ID_INLINE int FRAME2MS(int framenum)
Definition: Anim.h:48
const char * GetJointName(jointHandle_t handle) const
void CallFrameCommands(idEntity *ent, int from, int to) const
Definition: Anim_Blend.cpp:721
const int ANIMCHANNEL_TORSO
Definition: Anim.h:42
bool removeOriginOffset
Definition: Anim.h:583
int GetEndTime(void) const
void SetFrame(int channelNum, int animnum, int frame, int currenttime, int blendtime)
static bool CheckMayaInstall(void)
Definition: Anim_Import.cpp:86
const idAnim * Anim(void) const
jointHandle_t jointnum
Definition: Anim.h:93
int NumFrames(void) const
idRenderModel * ModelHandle(void) const
const int ANIMCHANNEL_LEGS
Definition: Anim.h:43
void GetSingleFrame(int framenum, idJointQuat *joints, const int *index, int numIndexes) const
Definition: Anim.cpp:820
size_t Allocated(void) const
Definition: Anim.cpp:148
int GetStartTime(void) const
void GetOriginRotation(idQuat &rotation, int time, int cyclecount) const
Definition: Anim.cpp:474
void BlendOrigin(int currentTime, idVec3 &blendPos, float &blendWeight, bool removeOriginOffset) const
bool allowMove
Definition: Anim.h:401
Definition: Anim.h:121
const int * GetChannelJoints(int channel) const
void CopyDecl(const idDeclModelDef *decl)
int GetSpecificAnim(const char *name) const
bool HasAnim(const char *name) const
float animWeights[ANIM_MaxSyncedAnims]
Definition: Anim.h:397
idEntity * GetEntity(void) const
idMat3 mat
Definition: Anim.h:94
idStr dest
Definition: Anim.h:205
void Zero(void)
Definition: Vector.h:415
size_t Allocated(void) const
void Restore(idRestoreGame *savefile, const idDeclModelDef *modelDef)
void SetAFPoseJointMod(const jointHandle_t jointNum, const AFJointModType_t mod, const idMat3 &axis, const idVec3 &origin)
const idJointQuat * GetDefaultPose(void) const
bool LoadAnim(const char *filename)
Definition: Anim.cpp:158
idStr realname
Definition: Anim.h:286
void ConvertTimeToFrame(int time, int cyclecount, frameBlend_t &frame) const
Definition: Anim.cpp:384
Definition: Anim.h:280
void ClearJoint(jointHandle_t jointnum)
bool allowFrameCommands
Definition: Anim.h:402
void SetEntity(idEntity *ent)
const idMD5Anim * anims[ANIM_MaxSyncedAnims]
Definition: Anim.h:283
int NumSyncedAnims(void) const
int num
Definition: Anim.h:158
void ClearAnimsInUse(void)
int NumFrames(void) const
Definition: Anim.cpp:89
bool RemoveOrigin(void) const
void SetPlaybackRate(int currentTime, float newRate)
bool ConvertMayaToMD5(void)
static bool initialized
Definition: Anim.h:200
short animNum
Definition: Anim.h:400
idStr name
Definition: Anim.h:237