-
Notifications
You must be signed in to change notification settings - Fork 0
/
LagComp.h
61 lines (49 loc) · 1.46 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
#include "Hooks.h"
#include "Hacks.h"
#include "ESP.h"
#include "Entities.h"
#include "SDK.h"
inline Vector AngleVector(Vector meme)
{
auto sy = sin(meme.y / 180.f * static_cast<float>(PI));
auto cy = cos(meme.y / 180.f * static_cast<float>(PI));
auto sp = sin(meme.x / 180.f * static_cast<float>(PI));
auto cp = cos(meme.x / 180.f* static_cast<float>(PI));
return Vector(cp*cy, cp*sy, -sp);
}
inline float DistPointToLine(Vector Point, Vector LineOrigin, Vector Dir)
{
auto PointDir = Point - LineOrigin;
auto TempOffset = PointDir.Dot(Dir) / (Dir.x*Dir.x + Dir.y*Dir.y + Dir.z*Dir.z);
if (TempOffset < 0.000001f)
return FLT_MAX;
auto PerpendicularPoint = LineOrigin + (Dir * TempOffset);
return (Point - PerpendicularPoint).Length();
}
struct lbyRecords
{
int tick_count;
float lby;
Vector headPosition;
};
struct backtrackData
{
float simtime;
Vector hitboxPos;
};
class BackTrack
{
int latest_tick;
bool IsTickValid(int tick);
bool Lowerbody(int tick);
void UpdateRecord(int i);
bool RunLBYBackTrack(int i, CInput::CUserCmd * cmd, IClientEntity * pEntity);
public:
lbyRecords records[64];
bool RunLBYBackTrack(int i, CInput::CUserCmd* cmd, Vector& aimPoint);
void Update(int tick_count);
void legitBackTrack(CUserCmd* cmd, IClientEntity* pLocal);
void ragebacktrack(CUserCmd * cmd, IClientEntity * pLocal);
};
extern backtrackData headPositions[64][12];
extern BackTrack* backtracking;