summaryrefslogtreecommitdiffstats
path: root/src/Entity.cpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-09-30 18:00:09 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2018-01-13 03:39:32 +0100
commitc149d9ac2492cecbd1ba336f231157f69413942b (patch)
tree9aa071b54b9e34639e8e39e15e48cc6773956aa7 /src/Entity.cpp
parent2017-09-24 (diff)
downloadAltCraft-c149d9ac2492cecbd1ba336f231157f69413942b.tar
AltCraft-c149d9ac2492cecbd1ba336f231157f69413942b.tar.gz
AltCraft-c149d9ac2492cecbd1ba336f231157f69413942b.tar.bz2
AltCraft-c149d9ac2492cecbd1ba336f231157f69413942b.tar.lz
AltCraft-c149d9ac2492cecbd1ba336f231157f69413942b.tar.xz
AltCraft-c149d9ac2492cecbd1ba336f231157f69413942b.tar.zst
AltCraft-c149d9ac2492cecbd1ba336f231157f69413942b.zip
Diffstat (limited to 'src/Entity.cpp')
-rw-r--r--src/Entity.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/Entity.cpp b/src/Entity.cpp
index cdfd85d..d91e78d 100644
--- a/src/Entity.cpp
+++ b/src/Entity.cpp
@@ -13,10 +13,26 @@ VectorF Entity::DecodeDeltaPos(short deltaX, short deltaY, short deltaZ)
return VectorF(deltaX / posMod, deltaY / posMod, deltaZ / posMod);
}
+double Entity::DecodeYaw(double yaw) {
+ return yaw + 90.0;
+}
+
+double Entity::DecodePitch(double pitch) {
+ return -pitch;
+}
+
+double Entity::EncodeYaw(double yaw) {
+ return yaw - 90.0;
+}
+
+double Entity::EncodePitch(double pitch) {
+ return -pitch;
+}
+
Entity CreateObject(ObjectType type)
{
Entity entity;
- entity.isMob = false;
+ entity.type = EntityType::Object;
switch (type) {
case ObjectType::Boat:
break;
@@ -82,5 +98,7 @@ Entity CreateObject(ObjectType type)
Entity CreateMob(MobType type)
{
- return Entity();
+ Entity entity;
+ entity.type = EntityType::Mob;
+ return entity;
}