From 140f58b4cae71671cd6f3c945f9102cd5011d966 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 28 Jun 2002 18:00:49 +0000 Subject: [PATCH] Patch from Julian Foad: Use defined constant instead of yet another approximation to pi. --- src/Scenery/tileentry.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Scenery/tileentry.cxx b/src/Scenery/tileentry.cxx index c571293c5..9ebeeb283 100644 --- a/src/Scenery/tileentry.cxx +++ b/src/Scenery/tileentry.cxx @@ -193,7 +193,7 @@ float g, float b, float a) float inv_length = 1.0 / sqrt(x*x + y*y + z*z); x *= inv_length; y *= inv_length; z *= inv_length; - float cos_angular_size = cos(angular_size*(22.0/7.0)/180.0); + float cos_angular_size = cos(angular_size*SG_DEGREES_TO_RADIANS); for( int s = 0; s < TEXRES_X; s++) { for( int t = 0; t < TEXRES_Y; t++) { @@ -258,11 +258,11 @@ void setColor2(float elevation_size,float azimuth_size, float r, float g, float //get elevation => project t onto the x-z-plane float tz_proj1 = tz / sqrt(tx*tx + tz*tz); - float televation = acos( -tz_proj1 ) * 180.0 / 3.1415; + float televation = acos( -tz_proj1 ) * SG_RADIANS_TO_DEGREES; //get azi => project t onto the y-z-plane float tz_proj2 = tz / sqrt(ty*ty + tz*tz); - float tazimuth = acos( -tz_proj2 ) * 180.0 / 3.1415; + float tazimuth = acos( -tz_proj2 ) * SG_RADIANS_TO_DEGREES; //note televation and tazimuth are the angles *between* the //temporary vector and the normal (0,0,-1). They are *NOT*