cleanup pi

use only one constant for Pi, in case we ever need to change it
This commit is contained in:
ac-stef
2017-04-28 15:18:00 +02:00
parent 967fd62077
commit 68c7ad1fe6
9 changed files with 21 additions and 78 deletions
+3 -4
View File
@@ -102,7 +102,6 @@ float RandomFloat (float from, float to)
void AnglesToVectors(vec angles, vec &forward, vec &right, vec &up)
{
static float degrees_to_radians = 2 * PI / 360;
float angle;
float sin_pitch;
float sin_yaw;
@@ -117,17 +116,17 @@ void AnglesToVectors(vec angles, vec &forward, vec &right, vec &up)
angles.y -= 90;
// compute the sin and cosine of the pitch component
angle = angles.x * degrees_to_radians;
angle = angles.x * RAD;
sin_pitch = sinf (angle);
cos_pitch = cosf (angle);
// compute the sin and cosine of the yaw component
angle = angles.y * degrees_to_radians;
angle = angles.y * RAD;
sin_yaw = sinf (angle);
cos_yaw = cosf (angle);
// compute the sin and cosine of the roll component
angle = angles.z * degrees_to_radians;
angle = angles.z * RAD;
sin_roll = sinf (angle);
cos_roll = cosf (angle);