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.

58 lines
1.2 KiB

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