-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEntity.cpp
More file actions
31 lines (23 loc) · 723 Bytes
/
Entity.cpp
File metadata and controls
31 lines (23 loc) · 723 Bytes
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
#include "Entity.h"
#include "Geom.h"
Entity::Entity(Memory *memory_p, uint32_t address_p) {
memory = memory_p;
address = address_p;
name = memory->ReadString(address + offsets::entity_name, 16);
team = memory->Read<int>(address + offsets::entity_team, 4);
}
Vec3 Entity::getHeadPos() {
return memory->ReadVec3(address + offsets::entity_head);
}
int Entity::getHealth() {
return memory->Read<uint32_t>(address + offsets::entity_health);
}
Vec3 Entity::getFeetPos() {
return memory->ReadVec3(address + offsets::entity_feet);
}
void Entity::setYaw(float yaw) {
memory->Write(address + offsets::entity_yaw, yaw);
}
void Entity::setPitch(float pitch) {
memory->Write(address + offsets::entity_pitch, pitch);
}