Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

112 lines
4.3 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //===========================================================================//
  8. #ifndef ANIMATION_H
  9. #define ANIMATION_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. #define ACTIVITY_NOT_AVAILABLE -1
  14. struct animevent_t;
  15. struct studiohdr_t;
  16. class CStudioHdr;
  17. struct mstudioseqdesc_t;
  18. int ExtractBbox( CStudioHdr *pstudiohdr, int sequence, Vector& mins, Vector& maxs );
  19. void IndexModelSequences( CStudioHdr *pstudiohdr );
  20. void ResetActivityIndexes( CStudioHdr *pstudiohdr );
  21. void VerifySequenceIndex( CStudioHdr *pstudiohdr );
  22. int SelectWeightedSequence( CStudioHdr *pstudiohdr, int activity, int curSequence = -1 );
  23. int SelectHeaviestSequence( CStudioHdr *pstudiohdr, int activity );
  24. void SetEventIndexForSequence( mstudioseqdesc_t &seqdesc );
  25. void BuildAllAnimationEventIndexes( CStudioHdr *pstudiohdr );
  26. void ResetEventIndexes( CStudioHdr *pstudiohdr );
  27. float GetSequenceLinearMotionAndDuration( CStudioHdr *pstudiohdr, int iSequence, const float poseParameter[], Vector *pVec );
  28. void GetEyePosition( CStudioHdr *pstudiohdr, Vector &vecEyePosition );
  29. int LookupActivity( CStudioHdr *pstudiohdr, const char *label );
  30. int LookupSequence( CStudioHdr *pstudiohdr, const char *label );
  31. #define NOMOTION 99999
  32. void GetSequenceLinearMotion( CStudioHdr *pstudiohdr, int iSequence, const float poseParameter[], Vector *pVec );
  33. const char *GetSequenceName( CStudioHdr *pstudiohdr, int sequence );
  34. const char *GetSequenceActivityName( CStudioHdr *pstudiohdr, int iSequence );
  35. int GetSequenceFlags( CStudioHdr *pstudiohdr, int sequence );
  36. int GetAnimationEvent( CStudioHdr *pstudiohdr, int sequence, animevent_t *pNPCEvent, float flStart, float flEnd, int index );
  37. bool HasAnimationEventOfType( CStudioHdr *pstudiohdr, int sequence, int type );
  38. int FindTransitionSequence( CStudioHdr *pstudiohdr, int iCurrentSequence, int iGoalSequence, int *piDir );
  39. bool GotoSequence( CStudioHdr *pstudiohdr, int iCurrentSequence, float flCurrentCycle, float flCurrentRate, int iGoalSequence, int &nNextSequence, float &flNextCycle, int &iNextDir );
  40. void SetBodygroup( CStudioHdr *pstudiohdr, int& body, int iGroup, int iValue );
  41. int GetBodygroup( CStudioHdr *pstudiohdr, int body, int iGroup );
  42. void SetBodygroupPreset( CStudioHdr *pstudiohdr, int& body, char const *szName );
  43. const char *GetBodygroupName( CStudioHdr *pstudiohdr, int iGroup );
  44. int FindBodygroupByName( CStudioHdr *pstudiohdr, const char *name );
  45. const char *GetBodygroupPartName( CStudioHdr *pstudiohdr, int iGroup, int iPart );
  46. int GetBodygroupCount( CStudioHdr *pstudiohdr, int iGroup );
  47. int GetNumBodyGroups( CStudioHdr *pstudiohdr );
  48. int GetSequenceActivity( CStudioHdr *pstudiohdr, int sequence, int *pweight = NULL );
  49. void GetAttachmentLocalSpace( CStudioHdr *pstudiohdr, int attachIndex, matrix3x4_t &pLocalToWorld );
  50. float SetBlending( CStudioHdr *pstudiohdr, int sequence, int *pblendings, int iBlender, float flValue );
  51. int FindHitboxSetByName( CStudioHdr *pstudiohdr, const char *name );
  52. const char *GetHitboxSetName( CStudioHdr *pstudiohdr, int setnumber );
  53. int GetHitboxSetCount( CStudioHdr *pstudiohdr );
  54. enum animtag_indices
  55. {
  56. ANIMTAG_INVALID = -1,
  57. ANIMTAG_UNINITIALIZED = 0,
  58. ANIMTAG_STARTCYCLE_N,
  59. ANIMTAG_STARTCYCLE_NE,
  60. ANIMTAG_STARTCYCLE_E,
  61. ANIMTAG_STARTCYCLE_SE,
  62. ANIMTAG_STARTCYCLE_S,
  63. ANIMTAG_STARTCYCLE_SW,
  64. ANIMTAG_STARTCYCLE_W,
  65. ANIMTAG_STARTCYCLE_NW,
  66. ANIMTAG_AIMLIMIT_YAWMIN_IDLE,
  67. ANIMTAG_AIMLIMIT_YAWMAX_IDLE,
  68. ANIMTAG_AIMLIMIT_YAWMIN_WALK,
  69. ANIMTAG_AIMLIMIT_YAWMAX_WALK,
  70. ANIMTAG_AIMLIMIT_YAWMIN_RUN,
  71. ANIMTAG_AIMLIMIT_YAWMAX_RUN,
  72. ANIMTAG_AIMLIMIT_YAWMIN_CROUCHIDLE,
  73. ANIMTAG_AIMLIMIT_YAWMAX_CROUCHIDLE,
  74. ANIMTAG_AIMLIMIT_YAWMIN_CROUCHWALK,
  75. ANIMTAG_AIMLIMIT_YAWMAX_CROUCHWALK,
  76. ANIMTAG_AIMLIMIT_PITCHMIN_IDLE,
  77. ANIMTAG_AIMLIMIT_PITCHMAX_IDLE,
  78. ANIMTAG_AIMLIMIT_PITCHMIN_WALKRUN,
  79. ANIMTAG_AIMLIMIT_PITCHMAX_WALKRUN,
  80. ANIMTAG_AIMLIMIT_PITCHMIN_CROUCH,
  81. ANIMTAG_AIMLIMIT_PITCHMAX_CROUCH,
  82. ANIMTAG_AIMLIMIT_PITCHMIN_CROUCHWALK,
  83. ANIMTAG_AIMLIMIT_PITCHMAX_CROUCHWALK,
  84. ANIMTAG_WEAPON_POSTLAYER,
  85. ANIMTAG_FLASHBANG_PASSABLE,
  86. ANIMTAG_COUNT
  87. };
  88. float GetFirstSequenceAnimTag( CStudioHdr *pstudiohdr, int sequence, int nDesiredTag, float flStart = 0, float flEnd = 1 );
  89. float GetAnySequenceAnimTag( CStudioHdr *pstudiohdr, int sequence, int nDesiredTag, float flDefault );
  90. #endif //ANIMATION_H