summaryrefslogtreecommitdiffstats
path: root/src/Entity.cpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2018-02-25 13:05:18 +0100
committerGitHub <noreply@github.com>2018-02-25 13:05:18 +0100
commit55e432becc8c5a1b8dd6543cc0a26e0213aeb88f (patch)
treef5d7dea2c6dc5a3d2feb8f4c0413f83beef61793 /src/Entity.cpp
parentRaycast debug render (diff)
parentmin/max functions (diff)
downloadAltCraft-55e432becc8c5a1b8dd6543cc0a26e0213aeb88f.tar
AltCraft-55e432becc8c5a1b8dd6543cc0a26e0213aeb88f.tar.gz
AltCraft-55e432becc8c5a1b8dd6543cc0a26e0213aeb88f.tar.bz2
AltCraft-55e432becc8c5a1b8dd6543cc0a26e0213aeb88f.tar.lz
AltCraft-55e432becc8c5a1b8dd6543cc0a26e0213aeb88f.tar.xz
AltCraft-55e432becc8c5a1b8dd6543cc0a26e0213aeb88f.tar.zst
AltCraft-55e432becc8c5a1b8dd6543cc0a26e0213aeb88f.zip
Diffstat (limited to 'src/Entity.cpp')
-rw-r--r--src/Entity.cpp128
1 files changed, 62 insertions, 66 deletions
diff --git a/src/Entity.cpp b/src/Entity.cpp
index d91e78d..a3a9527 100644
--- a/src/Entity.cpp
+++ b/src/Entity.cpp
@@ -1,14 +1,12 @@
#include "Entity.hpp"
-VectorF Entity::DecodeVelocity(short x, short y, short z)
-{
+VectorF Entity::DecodeVelocity(short x, short y, short z) {
const float ticksPerSecond = 20;
const double velMod = 1 / 8000.0;
return VectorF(x * velMod * ticksPerSecond, y*velMod*ticksPerSecond, z*velMod*ticksPerSecond);
}
-VectorF Entity::DecodeDeltaPos(short deltaX, short deltaY, short deltaZ)
-{
+VectorF Entity::DecodeDeltaPos(short deltaX, short deltaY, short deltaZ) {
const double posMod = 4096.0;
return VectorF(deltaX / posMod, deltaY / posMod, deltaZ / posMod);
}
@@ -29,75 +27,73 @@ double Entity::EncodePitch(double pitch) {
return -pitch;
}
-Entity CreateObject(ObjectType type)
-{
+Entity CreateObject(ObjectType type) {
Entity entity;
entity.type = EntityType::Object;
switch (type) {
- case ObjectType::Boat:
- break;
- case ObjectType::ItemStack:
- entity.width = 0.25;
- entity.height = 0.25;
- break;
- case ObjectType::AreaEffectCloud:
- break;
- case ObjectType::Minecart:
- break;
- case ObjectType::ActivatedTNT:
- break;
- case ObjectType::EnderCrystal:
- break;
- case ObjectType::TippedArrow:
- break;
- case ObjectType::Snowball:
- break;
- case ObjectType::Egg:
- break;
- case ObjectType::FireBall:
- break;
- case ObjectType::FireCharge:
- break;
- case ObjectType::ThrownEnderpearl:
- break;
- case ObjectType::WitherSkull:
- break;
- case ObjectType::ShulkerBullet:
- break;
- case ObjectType::LlamaSpit:
- break;
- case ObjectType::FallingObjects:
- break;
- case ObjectType::Itemframes:
- break;
- case ObjectType::EyeOfEnder:
- break;
- case ObjectType::ThrownPotion:
- break;
- case ObjectType::ThrownExpBottle:
- break;
- case ObjectType::FireworkRocket:
- break;
- case ObjectType::LeashKnot:
- break;
- case ObjectType::ArmorStand:
- break;
- case ObjectType::EvocationFangs:
- break;
- case ObjectType::FishingHook:
- break;
- case ObjectType::SpectralArrow:
- break;
- case ObjectType::DragonFireball:
- break;
- default:
- break;
+ case ObjectType::Boat:
+ break;
+ case ObjectType::ItemStack:
+ entity.width = 0.25;
+ entity.height = 0.25;
+ break;
+ case ObjectType::AreaEffectCloud:
+ break;
+ case ObjectType::Minecart:
+ break;
+ case ObjectType::ActivatedTNT:
+ break;
+ case ObjectType::EnderCrystal:
+ break;
+ case ObjectType::TippedArrow:
+ break;
+ case ObjectType::Snowball:
+ break;
+ case ObjectType::Egg:
+ break;
+ case ObjectType::FireBall:
+ break;
+ case ObjectType::FireCharge:
+ break;
+ case ObjectType::ThrownEnderpearl:
+ break;
+ case ObjectType::WitherSkull:
+ break;
+ case ObjectType::ShulkerBullet:
+ break;
+ case ObjectType::LlamaSpit:
+ break;
+ case ObjectType::FallingObjects:
+ break;
+ case ObjectType::Itemframes:
+ break;
+ case ObjectType::EyeOfEnder:
+ break;
+ case ObjectType::ThrownPotion:
+ break;
+ case ObjectType::ThrownExpBottle:
+ break;
+ case ObjectType::FireworkRocket:
+ break;
+ case ObjectType::LeashKnot:
+ break;
+ case ObjectType::ArmorStand:
+ break;
+ case ObjectType::EvocationFangs:
+ break;
+ case ObjectType::FishingHook:
+ break;
+ case ObjectType::SpectralArrow:
+ break;
+ case ObjectType::DragonFireball:
+ break;
+ default:
+ break;
}
return entity;
}
-Entity CreateMob(MobType type)
-{
+Entity CreateMob(MobType type) {
Entity entity;
entity.type = EntityType::Mob;
return entity;