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.

79 lines
2.0 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef TF_VIEWMODEL_H
  8. #define TF_VIEWMODEL_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "predictable_entity.h"
  13. #include "utlvector.h"
  14. #include "baseplayer_shared.h"
  15. #include "shared_classnames.h"
  16. #include "tf_weaponbase.h"
  17. #if defined( CLIENT_DLL )
  18. #include "c_baseanimating.h"
  19. #define CTFViewModel C_TFViewModel
  20. #endif
  21. class CTFViewModel : public CBaseViewModel
  22. {
  23. DECLARE_CLASS( CTFViewModel, CBaseViewModel );
  24. public:
  25. DECLARE_NETWORKCLASS();
  26. CTFViewModel( void );
  27. virtual ~CTFViewModel( void );
  28. virtual void CalcViewModelLag( Vector& origin, QAngle& angles, QAngle& original_angles );
  29. virtual void CalcViewModelView( CBasePlayer *owner, const Vector& eyePosition, const QAngle& eyeAngles );
  30. virtual void AddViewModelBob( CBasePlayer *owner, Vector& eyePosition, QAngle& eyeAngles );
  31. #if defined( CLIENT_DLL )
  32. virtual bool ShouldPredict( void )
  33. {
  34. if ( GetOwner() && GetOwner() == C_BasePlayer::GetLocalPlayer() )
  35. return true;
  36. return BaseClass::ShouldPredict();
  37. }
  38. virtual void StandardBlendingRules( CStudioHdr *hdr, Vector pos[], Quaternion q[], float currentTime, int boneMask );
  39. virtual void ProcessMuzzleFlashEvent( void );
  40. virtual int GetSkin();
  41. BobState_t &GetBobState() { return m_BobState; }
  42. virtual int DrawModel( int flags );
  43. virtual bool OnPostInternalDrawModel( ClientModelRenderInfo_t *pInfo );
  44. virtual const char* ModifyEventParticles( const char* token );
  45. #endif
  46. bool m_bBodygroupsDirty;
  47. private:
  48. void RecalculatePlayerBodygroups();
  49. #if defined( CLIENT_DLL )
  50. // This is used to lag the angles.
  51. CInterpolatedVar<QAngle> m_LagAnglesHistory;
  52. QAngle m_vLagAngles;
  53. BobState_t m_BobState; // view model head bob state
  54. CTFViewModel( const CTFViewModel & ); // not defined, not accessible
  55. QAngle m_vLoweredWeaponOffset;
  56. #endif
  57. };
  58. #endif // TF_VIEWMODEL_H