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.

60 lines
1.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================
  7. #ifndef DOD_VIEWMODEL_H
  8. #define DOD_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. #if defined( CLIENT_DLL )
  17. #define CDODViewModel C_DODViewModel
  18. #endif
  19. class CDODViewModel : public CBaseViewModel
  20. {
  21. DECLARE_CLASS( CDODViewModel, CBaseViewModel );
  22. public:
  23. DECLARE_NETWORKCLASS();
  24. CDODViewModel( void );
  25. ~CDODViewModel( void );
  26. virtual void CalcViewModelLag( Vector& origin, QAngle& angles, QAngle& original_angles );
  27. virtual void CalcViewModelView( CBasePlayer *owner, const Vector& eyePosition, const QAngle& eyeAngles );
  28. #if defined( CLIENT_DLL )
  29. virtual bool ShouldPredict( void )
  30. {
  31. if ( GetOwner() && GetOwner() == C_BasePlayer::GetLocalPlayer() )
  32. return true;
  33. return BaseClass::ShouldPredict();
  34. }
  35. #endif
  36. private:
  37. #if defined( CLIENT_DLL )
  38. // This is used to lag the angles.
  39. CInterpolatedVar<QAngle> m_LagAnglesHistory;
  40. QAngle m_vLagAngles;
  41. CDODViewModel( const CDODViewModel & ); // not defined, not accessible
  42. QAngle m_vLoweredWeaponOffset;
  43. #endif
  44. };
  45. #endif // DOD_VIEWMODEL_H