source-engine/game/shared/predicted_viewmodel.h

60 lines
1.3 KiB
C
Raw Normal View History

2023-10-03 14:23:56 +00:00
//========= Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ============//
2020-04-22 16:56:21 +00:00
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef PREDICTED_VIEWMODEL_H
#define PREDICTED_VIEWMODEL_H
#ifdef _WIN32
#pragma once
#endif
#include "predictable_entity.h"
#include "utlvector.h"
#include "baseplayer_shared.h"
#include "shared_classnames.h"
#if defined( CLIENT_DLL )
#define CPredictedViewModel C_PredictedViewModel
#endif
class CPredictedViewModel : public CBaseViewModel
{
DECLARE_CLASS( CPredictedViewModel, CBaseViewModel );
public:
DECLARE_NETWORKCLASS();
CPredictedViewModel( void );
virtual ~CPredictedViewModel( void );
virtual void CalcViewModelLag( Vector& origin, QAngle& angles, QAngle& original_angles );
#if defined( CLIENT_DLL )
virtual bool ShouldPredict( void )
{
2023-10-03 14:23:56 +00:00
if ( C_BasePlayer::IsLocalPlayer( GetOwner() ) )
2020-04-22 16:56:21 +00:00
return true;
return BaseClass::ShouldPredict();
}
#endif
private:
#if defined( CLIENT_DLL )
// This is used to lag the angles.
CInterpolatedVar<QAngle> m_LagAnglesHistory;
QAngle m_vLagAngles;
2023-10-03 14:23:56 +00:00
Vector m_vPredictedOffset;
2020-04-22 16:56:21 +00:00
CPredictedViewModel( const CPredictedViewModel & ); // not defined, not accessible
#endif
};
#endif // PREDICTED_VIEWMODEL_H