forked from sstokic-tgm/Gladiatorcheatz-Public
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameMovement.cpp
137 lines (99 loc) · 2.72 KB
/
GameMovement.cpp
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#include "harCs.hpp"
#include "GameMovement.hpp"
RebuildGameMovement::RebuildGameMovement(void)
{
}
void RebuildGameMovement::SetAbsOrigin(Entity *player, const Vector3 &vec)
{
if (player && player->getMoveTip() == MOVETYPE_WALK)
{
trace_t pm;
TracePlayerBBox(vec, vec, MASK_PLAYERSOLID, COLLISION_GROUP_PLAYER_MOVEMENT, pm, player);
if (pm.startsolid || pm.allsolid || pm.fraction != 1.0f)
{
//player will get stuck, lets not?
return;
}
}
player->getAbsOriginal() = vec;
}
int RebuildGameMovement::ClipVelocity(Vector3 &in, Vector3 &normal, Vector3 &out, float overbounce)
{
return 0;
}
int RebuildGameMovement::TryPlayerMove(Entity *player, Vector3 *pFirstDest, trace_t *pFirstTrace)
{
return 0;
}
void RebuildGameMovement::Accelerate(Entity *player, Vector3 &wishdir, float wishspeed, float accel)
{
}
void RebuildGameMovement::AirAccelerate(Entity *player, Vector3 &wishdir, float wishspeed, float accel)
{
}
void RebuildGameMovement::AirMove(Entity *player)
{
}
void RebuildGameMovement::StepMove(Entity *player, Vector3 &vecDestination, trace_t &trace)
{
}
void RebuildGameMovement::TracePlayerBBox(const Vector3 &start, const Vector3 &end, unsigned int fMask, int collisionGroup, trace_t& pm, Entity *player)
{
Ray_t ray;
TraceFilter filter;
filter.pSkip = reinterpret_cast<void*>(player);
ray.Init(start, end, player->getCollideable()->vecMins(), player->getCollideable()->vecMax());
p_EngineTrace->TraceRay(ray, fMask, &filter, &pm);
}
void RebuildGameMovement::WalkMove(Entity *player)
{
}
void RebuildGameMovement::FinishGravity(Entity *player)
{
}
void RebuildGameMovement::FullWalkMove(Entity *player)
{
// ~ deleted parts cause pub release
StartGravity(player);
// Fricion is handled before we add in any base velocity. That way, if we are on a conveyor,
// we don't slow when standing still, relative to the conveyor.
if (player->getFlags() & FL_ONGROUND)
{
player->getVel()[2] = 0.0;
Friction(player);
}
// Make sure velocity is valid.
CheckVelocity(player);
if (player->getFlags() & FL_ONGROUND)
{
WalkMove(player);
}
else
{
AirMove(player); // Take into account movement when in air.
}
// Make sure velocity is valid.
CheckVelocity(player);
// Add any remaining gravitational component.
FinishGravity(player);
// If we are on ground, no downward velocity.
if (player->getFlags() & FL_ONGROUND)
{
player->getVel()[2] = 0;
}
CheckFalling(player);
}
void RebuildGameMovement::Friction(Entity *player)
{
}
void RebuildGameMovement::CheckFalling(Entity *player)
{
}
const int nanmask = 255 << 23;
#define IS_NAN(x) (((*(int *)&x)&nanmask)==nanmask)
void RebuildGameMovement::CheckVelocity(Entity *player)
{
}
void RebuildGameMovement::StartGravity(Entity *player)
{
}