forked from DK22Pac/plugin-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCPlaceable.cpp
More file actions
111 lines (91 loc) · 2.7 KB
/
CPlaceable.cpp
File metadata and controls
111 lines (91 loc) · 2.7 KB
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
/*
Plugin-SDK (Grand Theft Auto San Andreas) source file
Authors: GTA Community. See more here
https://github.com/DK22Pac/plugin-sdk
Do not delete this comment block. Respect others' work!
*/
#include "CPlaceable.h"
CVector CPlaceable::GetRightDirection()
{
return ((CVector (__thiscall *)(CPlaceable *))0x41CC70)(this);
}
CVector CPlaceable::GetTopDirection()
{
return ((CVector (__thiscall *)(CPlaceable *))0x41CCB0)(this);
}
CVector CPlaceable::GetAtDirection()
{
return ((CVector (__thiscall *)(CPlaceable *))0x50E420)(this);
}
void CPlaceable::SetPosn(float x, float y, float z)
{
((void (__thiscall *)(CPlaceable *, float, float, float))0x420B80)(this, x, y, z);
}
void CPlaceable::SetPosn(CVector const& posn)
{
((void (__thiscall *)(CPlaceable *, CVector const&))0x4241C0)(this, posn);
}
void CPlaceable::SetOrientation(float x, float y, float z)
{
((void (__thiscall *)(CPlaceable *, float, float, float))0x439A80)(this, x, y, z);
}
void CPlaceable::SetHeading(float heading)
{
((void (__thiscall *)(CPlaceable *, float))0x43E0C0)(this, heading);
}
float CPlaceable::GetHeading()
{
return ((float (__thiscall *)(CPlaceable *))0x441DB0)(this);
}
bool CPlaceable::IsWithinArea(float x1, float y1, float x2, float y2)
{
return ((bool (__thiscall *)(CPlaceable *, float, float, float, float))0x54F200)(this, x1, y1, x2, y2);
}
bool CPlaceable::IsWithinArea(float x1, float y1, float z1, float x2, float y2, float z2)
{
return ((bool (__thiscall *)(CPlaceable *, float, float, float, float, float, float))0x54F2B0)(this, x1, y1, z1, x2, y2, z2);
}
void CPlaceable::RemoveMatrix()
{
((void (__thiscall *)(CPlaceable *))0x54F3B0)(this);
}
void CPlaceable::AllocateStaticMatrix()
{
((void (__thiscall *)(CPlaceable *))0x54F4C0)(this);
}
void CPlaceable::AllocateMatrix()
{
((void (__thiscall *)(CPlaceable *))0x54F560)(this);
}
void CPlaceable::SetMatrix(CMatrix const& matrix)
{
((void (__thiscall *)(CPlaceable *, CMatrix const&))0x54F610)(this, matrix);
}
CMatrixLink& CPlaceable::GetMatrix() {
return *((CMatrixLink *(__thiscall *)(CPlaceable *))0x411990)(this);
}
void CPlaceable::ShutdownMatrixArray() {
((void(__cdecl *)())0x54EFD0)();
}
void CPlaceable::InitMatrixArray() {
((void(__cdecl *)())0x54F3A0)();
}
void CPlaceable::FreeStaticMatrix() {
((void(__thiscall *)(CPlaceable *))0x54F010)(this);
}
void CPlaceable::GetOrientation(float& x, float& y, float& z)
{
if (this->m_matrix)
{
x = asinf(this->m_matrix->up.z);
float cosx = cosf(x);
float cosy = this->m_matrix->at.z / cosx;
y = acosf(cosy);
float cosz = this->m_matrix->up.y / cosx;
z = acosf(cosz);
}
else
{
z = this->m_placement.m_fHeading;
}
}