1
0
forked from mirrors/0ad

move M_PI etc. to wposix.h to ensure they're always present on Windows (previously required MathUtil.h)

use M_PI instead of nonstandard PI

This was SVN commit r7380.
This commit is contained in:
janwas
2010-03-20 20:54:03 +00:00
parent d1c5119694
commit 0bbb99c3cd
19 changed files with 76 additions and 78 deletions
+3 -3
View File
@@ -154,7 +154,7 @@ JSBool CEntity::Construct( JSContext* cx, JSObject* UNUSED(obj), uintN argc, jsv
debug_assert( argc >= 2 );
CVector3D position;
float orientation = g_Game->GetSimulation()->RandFloat() * 2 * PI;
float orientation = g_Game->GetSimulation()->RandFloat() * 2 * M_PI;
JSObject* jsEntityTemplate = JSVAL_TO_OBJECT( argv[0] );
CStrW templateName;
@@ -502,10 +502,10 @@ jsval_t CEntity::GetSpawnPoint( JSContext* UNUSED(cx), uintN argc, jsval* argv )
else if( m_bounds->m_type == CBoundingObject::BOUND_CIRCLE )
{
float ang;
ang = g_Game->GetSimulation()->RandFloat() * 2 * PI;
ang = g_Game->GetSimulation()->RandFloat() * 2 * M_PI;
float radius = m_bounds->m_radius + 1.0f + spawn_clearance;
float d_ang = spawn_clearance / ( 2.0f * radius );
float ang_end = ang + 2.0f * PI;
float ang_end = ang + 2.0f * M_PI;
float x = 0.0f, y = 0.0f; // make sure they're initialized
for( ; ang < ang_end; ang += d_ang )
{