-
Notifications
You must be signed in to change notification settings - Fork 30
/
lagcomp.h
98 lines (72 loc) · 2.28 KB
/
lagcomp.h
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#pragma once
class AimPlayer;
class LagComp {
public:
struct LagRecord_t {
struct LayerData_t {
int m_nSequence;
float m_flPlaybackRate;
float m_flCycle;
float m_flWeight;
float m_flWeightWithAirSmooth;
float m_flFeetWeight;
float m_flMovementSide;
ang_t m_angMoveYaw;
vec3_t m_vecDirection;
};
LagRecord_t( ) = default;
explicit LagRecord_t( Player* pEntity );
explicit LagRecord_t( Player* pEntity, ang_t vecLastReliableAngle );
void Restore( Player* pEntity );
void Apply( Player* pEntity );
bool IsValid( float flSimulationTime, bool bValid, const float flRange = 0.2f );
void BuildBones( Player* player, bool resolve = false );
Player* m_pEntity;
int m_iEntIndex;
bool m_bValid;
BoneArray m_pMatrix[128];
BoneArray m_pMatrix_Resolved[ 128 ];
//BoneArray m_pMatrix_Resolved_Inverted[128];
BoneArray center_matrix[ 128 ];
BoneArray left_matrix[ 128 ];
BoneArray right_matrix[ 128 ];
C_AnimationLayer right_layers[ 13 ];
C_AnimationLayer left_layers[ 13 ];
C_AnimationLayer center_layers[ 13 ];
bool m_bDormant;
vec3_t m_vecVelocity;
vec3_t m_vecOrigin;
vec3_t m_vecAbsOrigin;
vec3_t m_vecMins;
vec3_t m_vecMaxs;
C_AnimationLayer m_pLayers[ 13 ];
float m_pPoses[ 24 ];
CCSGOPlayerAnimState* m_pState;
float m_flSimulationTime;
float m_flInterpTime;
float m_flDuck;
float m_flLowerBodyYawTarget;
float m_flLastShotTime;
float m_flSpawnTime;
ang_t m_angLastReliableAngle;
ang_t m_angEyeAngles;
ang_t m_angAbsAngles;
CBaseHandle m_ulEntHandle;
int m_fFlags;
int m_iEFlags;
int m_iEffects;
int m_iChoked;
bool m_bDidShot;
bool m_bPrefer = false;
bool m_bAllowAnimationUpdate;
bool m_bAnimatePlayer;
LayerData_t m_LayerData[ 3 ];
};
void PostPlayerUpdate( );
bool BreakingLagCompensation( Player* pEntity );
std::optional<LagRecord_t*> GetLatestRecord( Player* pEntity );
std::optional<LagRecord_t*> GetOldestRecord( Player* pEntity );
std::optional<std::pair<LagRecord_t*, LagRecord_t*>> GetViableRecords( Player* pEntity, float flRange = 1.0f );
std::vector<LagComp::LagRecord_t*> GetValidRecords( Player* pEntity, const float flRange = 1.0f );
};
extern LagComp g_lagcompensation;