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.

88 lines
3.1 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef IPLAYERANIMSTATE_H
  7. #define IPLAYERANIMSTATE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. typedef enum
  12. {
  13. LEGANIM_9WAY, // Legs use a 9-way blend, with "move_x" and "move_y" pose parameters.
  14. LEGANIM_8WAY, // Legs use an 8-way blend with "move_yaw" pose param.
  15. LEGANIM_GOLDSRC // Legs always point in the direction he's running and the torso rotates.
  16. } LegAnimType_t;
  17. #ifdef CSTRIKE15
  18. enum PlayerAnimEvent_t
  19. {
  20. PLAYERANIMEVENT_FIRE_GUN_PRIMARY=0,
  21. PLAYERANIMEVENT_FIRE_GUN_PRIMARY_OPT, // an optional primary attack for variation in animation. For example, the knife toggles between left AND right slash animations.
  22. PLAYERANIMEVENT_FIRE_GUN_PRIMARY_SPECIAL1,
  23. PLAYERANIMEVENT_FIRE_GUN_PRIMARY_OPT_SPECIAL1, // an optional primary special attack for variation in animation.
  24. PLAYERANIMEVENT_FIRE_GUN_SECONDARY,
  25. PLAYERANIMEVENT_FIRE_GUN_SECONDARY_SPECIAL1,
  26. PLAYERANIMEVENT_GRENADE_PULL_PIN,
  27. PLAYERANIMEVENT_THROW_GRENADE,
  28. PLAYERANIMEVENT_JUMP,
  29. PLAYERANIMEVENT_RELOAD,
  30. PLAYERANIMEVENT_RELOAD_START, ///< w_model partial reload for shotguns
  31. PLAYERANIMEVENT_RELOAD_LOOP, ///< w_model partial reload for shotguns
  32. PLAYERANIMEVENT_RELOAD_END, ///< w_model partial reload for shotguns
  33. PLAYERANIMEVENT_CLEAR_FIRING, ///< clear animations on the firing layer
  34. PLAYERANIMEVENT_DEPLOY, ///< Used to play deploy animations on third person models.
  35. PLAYERANIMEVENT_SILENCER_ATTACH,
  36. PLAYERANIMEVENT_SILENCER_DETACH,
  37. // new events
  38. PLAYERANIMEVENT_THROW_GRENADE_UNDERHAND,
  39. PLAYERANIMEVENT_CATCH_WEAPON,
  40. PLAYERANIMEVENT_COUNT
  41. };
  42. #endif
  43. abstract_class IPlayerAnimState
  44. {
  45. public:
  46. virtual void Release() = 0;
  47. // Update() and DoAnimationEvent() together maintain the entire player's animation state.
  48. //
  49. // Update() maintains the the lower body animation (the player's m_nSequence)
  50. // and the upper body overlay based on the player's velocity and look direction.
  51. //
  52. // It also modulates these based on events triggered by DoAnimationEvent.
  53. virtual void Update( float eyeYaw, float eyePitch ) = 0;
  54. virtual void ModifyTauntDuration( float flTimingChange ) {}
  55. // This is called by the client when a new player enters the PVS to clear any events
  56. // the dormant version of the entity may have been playing.
  57. virtual void ClearAnimationState() = 0;
  58. // The client uses this to figure out what angles to render the entity with (since as the guy turns,
  59. // it will change his body_yaw pose parameter before changing his rendered angle).
  60. virtual const QAngle& GetRenderAngles() = 0;
  61. virtual void SetForceAimYaw( bool bForce ) = 0;
  62. #ifdef CSTRIKE15
  63. // This is called by both the client and the server in the same way to trigger events for
  64. // players firing, jumping, throwing grenades, etc.
  65. virtual void DoAnimationEvent( PlayerAnimEvent_t event, int nData = 0 ) = 0;
  66. // Returns true if we're playing the grenade prime or throw animation.
  67. virtual bool IsThrowingGrenade() = 0;
  68. virtual bool ShouldHideGrenadeDuringThrow() = 0;
  69. #endif
  70. };
  71. #endif // IPLAYERANIMSTATE_H