summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2009-11-06 13:27:28 +0000
committerTofu Linden <tofu.linden@lindenlab.com>2009-11-06 13:27:28 +0000
commit904f6124b282e3e9668289bef9f7d44f8539ce51 (patch)
tree38c1ad84a20240d48b1c31e4d6d569122bf1b724 /indra/newview
parentd78520f6b7fd4a20bbb1d1291a34761efc1fd740 (diff)
magic number removal rampage: 3.14159 -> M_PI or F_PI
--HG-- branch : texture-pipeline
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfloaterworldmap.cpp2
-rw-r--r--indra/newview/lltracker.cpp6
-rw-r--r--indra/newview/llvoavatar.cpp4
-rw-r--r--indra/newview/llvovolume.cpp8
-rw-r--r--indra/newview/llworldmapview.cpp2
-rw-r--r--indra/newview/pipeline.cpp2
6 files changed, 12 insertions, 12 deletions
diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp
index b7e8835fb8..d3c6248faf 100644
--- a/indra/newview/llfloaterworldmap.cpp
+++ b/indra/newview/llfloaterworldmap.cpp
@@ -427,7 +427,7 @@ void LLFloaterWorldMap::draw()
{
F64 seconds = LLTimer::getElapsedSeconds();
double value = fmod(seconds, 2);
- value = 0.5 + 0.5*cos(value * 3.14159f);
+ value = 0.5 + 0.5*cos(value * M_PI);
LLColor4 loading_color(0.0, F32(value/2), F32(value), 1.0);
childSetColor("location_icon", loading_color);
}
diff --git a/indra/newview/lltracker.cpp b/indra/newview/lltracker.cpp
index 5929ecd928..1a61717658 100644
--- a/indra/newview/lltracker.cpp
+++ b/indra/newview/lltracker.cpp
@@ -416,10 +416,10 @@ F32 pulse_func(F32 t, F32 z)
return 0.f;
}
- t *= 3.14159f;
+ t *= F_PI;
z -= t*64.f - 256.f;
- F32 a = cosf(z*3.14159/512.f)*10.0f;
+ F32 a = cosf(z*F_PI/512.f)*10.0f;
a = llmax(a, 9.9f);
a -= 9.9f;
a *= 10.f;
@@ -433,7 +433,7 @@ void draw_shockwave(F32 center_z, F32 t, S32 steps, LLColor4 color)
return;
}
- t *= 0.6284f/3.14159f;
+ t *= 0.6284f/F_PI;
t -= (F32) (S32) t;
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 76e00db91c..3aca2ed904 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -2381,7 +2381,7 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update)
F32 old_angle = mImpostorAngle.mV[i];
F32 angle_diff = fabsf(cur_angle-old_angle);
- if (angle_diff > 3.14159f/512.f*distance*mUpdatePeriod)
+ if (angle_diff > F_PI/512.f*distance*mUpdatePeriod)
{
mNeedsImpostorUpdate = TRUE;
}
@@ -2542,7 +2542,7 @@ void LLVOAvatar::idleUpdateLoadingEffect()
particle_parameters.mPartImageID = cloud->getID();
particle_parameters.mMaxAge = 0.f;
particle_parameters.mPattern = LLPartSysData::LL_PART_SRC_PATTERN_ANGLE_CONE;
- particle_parameters.mInnerAngle = 3.14159f;
+ particle_parameters.mInnerAngle = F_PI;
particle_parameters.mOuterAngle = 0.f;
particle_parameters.mBurstRate = 0.02f;
particle_parameters.mBurstRadius = 0.0f;
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 1704f63376..421e6fdff5 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -739,15 +739,15 @@ F32 LLVOVolume::getTextureVirtualSize(LLFace* face)
face->setPixelArea(face_area);
- if (face_area <= 0)
+ if (face_area <= 0.f)
{
return 0.f;
}
//get area of circle in texture space
LLVector2 tdim = face->mTexExtents[1] - face->mTexExtents[0];
- F32 texel_area = (tdim * 0.5f).lengthSquared()*3.14159f;
- if (texel_area <= 0)
+ F32 texel_area = (tdim * 0.5f).lengthSquared()*F_PI;
+ if (texel_area <= 0.f)
{
// Probably animated, use default
texel_area = 1.f;
@@ -1036,7 +1036,7 @@ BOOL LLVOVolume::calcLOD()
}
// DON'T Compensate for field of view changing on FOV zoom.
- distance *= 3.14159f/3.f;
+ distance *= F_PI/3.f;
cur_detail = computeLODDetail(llround(distance, 0.01f),
llround(radius, 0.01f));
diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp
index 5446a08ebf..bd2e1e6621 100644
--- a/indra/newview/llworldmapview.cpp
+++ b/indra/newview/llworldmapview.cpp
@@ -821,7 +821,7 @@ void LLWorldMapView::draw()
else
{
double value = fmod(current_time, 2);
- value = 0.5 + 0.5*cos(value * 3.14159f);
+ value = 0.5 + 0.5*cos(value * M_PI);
LLColor4 loading_color(0.0, F32(value/2), F32(value), 1.0);
drawTracking( LLWorldMap::getInstance()->mUnknownLocation, loading_color, TRUE, getString("Loading"), "");
}
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index b50e71bf48..f2442a49c0 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -1474,7 +1474,7 @@ F32 LLPipeline::calcPixelArea(LLVector3 center, LLVector3 size, LLCamera &camera
//get area of circle around node
F32 app_angle = atanf(size.length()/dist);
F32 radius = app_angle*LLDrawable::sCurPixelAngle;
- return radius*radius * 3.14159f;
+ return radius*radius * F_PI;
}
void LLPipeline::grabReferences(LLCullResult& result)