summaryrefslogtreecommitdiff
path: root/game/shared/dod/dod_viewmodel.h
blob: 4192a7829a4489a8aea4937441b152bae8693797 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//=============================================================================

#ifndef DOD_VIEWMODEL_H
#define DOD_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 CDODViewModel C_DODViewModel
#endif

class CDODViewModel : public CBaseViewModel
{
	DECLARE_CLASS( CDODViewModel, CBaseViewModel );
public:

	DECLARE_NETWORKCLASS();

	CDODViewModel( void );
	~CDODViewModel( void );

	virtual void CalcViewModelLag( Vector& origin, QAngle& angles, QAngle& original_angles );
	virtual void CalcViewModelView( CBasePlayer *owner, const Vector& eyePosition, const QAngle& eyeAngles );

#if defined( CLIENT_DLL )
	virtual bool ShouldPredict( void )
	{
		if ( GetOwner() && GetOwner() == C_BasePlayer::GetLocalPlayer() )
			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;

	CDODViewModel( const CDODViewModel & ); // not defined, not accessible

	QAngle m_vLoweredWeaponOffset;
#endif
};

#endif // DOD_VIEWMODEL_H