From a4e84cbf20a6b1e13d972c51caa412f8d86564f7 Mon Sep 17 00:00:00 2001 From: ac-stef Date: Wed, 24 Aug 2016 12:38:33 +0200 Subject: [PATCH] cleanup --- source/src/entities.cpp | 4 ++-- source/src/physics.cpp | 29 ----------------------------- source/src/protos.h | 2 -- 3 files changed, 2 insertions(+), 33 deletions(-) diff --git a/source/src/entities.cpp b/source/src/entities.cpp index f1118a7a..c816328b 100644 --- a/source/src/entities.cpp +++ b/source/src/entities.cpp @@ -278,8 +278,8 @@ void renderentities() case PLAYERSTART: { glColor3f(0, 1, 1); - vec dir; - vecfromyawpitch(float(e.attr1) / ENTSCALE10, 0, -1, 0, dir); + vec dir(0, -1, 0); + dir.rotate_around_z(float(e.attr1) / ENTSCALE10 * RAD); renderentarrow(e, dir, 4); glColor3f(1, 1, 1); } diff --git a/source/src/physics.cpp b/source/src/physics.cpp index 0b794154..950fdc65 100644 --- a/source/src/physics.cpp +++ b/source/src/physics.cpp @@ -1112,32 +1112,3 @@ void entinmap(physent *d) // brute force but effective way to find a free spa conoutf("can't find entity spawn spot! (%d, %d)", int(d->o.x), int(d->o.y)); } -void vecfromyawpitch(float yaw, float pitch, int move, int strafe, vec &m) -{ - if(move) - { - m.x = move*-sinf(RAD*yaw); - m.y = move*cosf(RAD*yaw); - } - else m.x = m.y = 0; - - if(pitch) - { - m.x *= cosf(RAD*pitch); - m.y *= cosf(RAD*pitch); - m.z = move*sinf(RAD*pitch); - } - else m.z = 0; - - if(strafe) - { - m.x += strafe*cosf(RAD*yaw); - m.y += strafe*sinf(RAD*yaw); - } -} - -void vectoyawpitch(const vec &v, float &yaw, float &pitch) -{ - yaw = -atan2(v.x, v.y)/RAD; - pitch = asin(v.z/v.magnitude())/RAD; -} diff --git a/source/src/protos.h b/source/src/protos.h index 75d589c1..861244d0 100644 --- a/source/src/protos.h +++ b/source/src/protos.h @@ -775,8 +775,6 @@ extern void updatecrouch(playerent *p, bool on); extern bool objcollide(physent *d, const vec &objpos, float objrad, float objheight); extern bool collide(physent *d, bool spawn = false, float drop = 0, float rise = 0); extern void attack(bool on); -extern void vecfromyawpitch(float yaw, float pitch, int move, int strafe, vec &m); -extern void vectoyawpitch(const vec &v, float &yaw, float &pitch); // sound /*