Team Fortress 2 Source Code as on 22/4/2020
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.

87 lines
2.7 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef TF_PLAYERANIMSTATE_H
  7. #define TF_PLAYERANIMSTATE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "convar.h"
  12. #include "../Multiplayer/multiplayer_animstate.h"
  13. #if defined( CLIENT_DLL )
  14. class C_TFPlayer;
  15. #define CTFPlayer C_TFPlayer
  16. #else
  17. class CTFPlayer;
  18. #endif
  19. // ------------------------------------------------------------------------------------------------ //
  20. // CPlayerAnimState declaration.
  21. // ------------------------------------------------------------------------------------------------ //
  22. class CTFPlayerAnimState : public CMultiPlayerAnimState
  23. {
  24. public:
  25. DECLARE_CLASS( CTFPlayerAnimState, CMultiPlayerAnimState );
  26. CTFPlayerAnimState();
  27. CTFPlayerAnimState( CBasePlayer *pPlayer, MultiPlayerMovementData_t &movementData );
  28. ~CTFPlayerAnimState();
  29. void InitTF( CTFPlayer *pPlayer );
  30. CTFPlayer *GetTFPlayer( void ) { return m_pTFPlayer; }
  31. virtual void ClearAnimationState();
  32. virtual Activity TranslateActivity( Activity actDesired );
  33. Activity ActivityOverride( Activity baseAct, bool *pRequired );
  34. virtual void Update( float eyeYaw, float eyePitch );
  35. void DoAnimationEvent( PlayerAnimEvent_t event, int nData = 0 );
  36. virtual void CheckStunAnimation();
  37. virtual Activity CalcMainActivity();
  38. virtual void ComputePoseParam_AimYaw( CStudioHdr *pStudioHdr );
  39. void CheckPasstimeThrowAnimation();
  40. virtual float GetCurrentMaxGroundSpeed();
  41. virtual float GetGesturePlaybackRate( void );
  42. bool HandleMoving( Activity &idealActivity );
  43. bool HandleJumping( Activity &idealActivity );
  44. bool HandleDucking( Activity &idealActivity );
  45. bool HandleSwimming( Activity &idealActivity );
  46. virtual bool ShouldUpdateAnimState();
  47. virtual void GetOuterAbsVelocity( Vector& vel );
  48. bool IsItemTestingBot( void );
  49. virtual void RestartGesture( int iGestureSlot, Activity iGestureActivity, bool bAutoKill = true );
  50. void SetRenderangles( const QAngle& angles ) { m_angRender = angles; }
  51. void Vehicle_LeanAccel( float flInAccel );
  52. private:
  53. void Taunt_ComputePoseParam_MoveX( CStudioHdr *pStudioHdr );
  54. void Taunt_ComputePoseParam_MoveY( CStudioHdr *pStudioHdr );
  55. void Vehicle_ComputePoseParam_MoveYaw( CStudioHdr *pStudioHdr );
  56. void Vehicle_ComputePoseParam_AccelLean( CStudioHdr *pStudioHdr );
  57. CTFPlayer *m_pTFPlayer;
  58. bool m_bInAirWalk;
  59. float m_flHoldDeployedPoseUntilTime;
  60. float m_flTauntMoveX;
  61. float m_flTauntMoveY;
  62. float m_flVehicleLeanVel;
  63. float m_flVehicleLeanPos;
  64. Vector m_vecSmoothedUp;
  65. };
  66. CTFPlayerAnimState *CreateTFPlayerAnimState( CTFPlayer *pPlayer );
  67. #endif // TF_PLAYERANIMSTATE_H