cleanup
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user