1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-20 04:09:16 +00:00

Eliminate hsScalar and hsFixed

Modern CPUs support floats just fine... hsFixed was crazy.
This commit is contained in:
2012-01-21 02:03:37 -05:00
parent 5027b5a4ac
commit e020651e4b
584 changed files with 5401 additions and 6399 deletions

View File

@ -66,20 +66,20 @@ plCullPoly& plCullPoly::InitFromVerts(uint32_t f)
{
fCenter += fVerts[i];
}
fCenter *= 1.f / hsScalar(fVerts.GetCount());
fCenter *= 1.f / float(fVerts.GetCount());
fRadius = ICalcRadius();
return *this;
}
hsScalar plCullPoly::ICalcRadius() const
float plCullPoly::ICalcRadius() const
{
hsScalar radSq = 0;
float radSq = 0;
int i;
for( i = 0; i < fVerts.GetCount(); i++ )
{
hsScalar tmpSq = hsVector3(&fVerts[i], &fCenter).MagnitudeSquared();
float tmpSq = hsVector3(&fVerts[i], &fCenter).MagnitudeSquared();
if( tmpSq > radSq )
radSq = tmpSq;
}
@ -169,8 +169,8 @@ void plCullPoly::Write(hsStream* s, hsResMgr* mgr)
#ifdef MF_VALIDATE_POLYS
hsBool plCullPoly::Validate() const
{
const hsScalar kMinMag = 1.e-8f;
hsScalar magSq = fNorm.MagnitudeSquared();
const float kMinMag = 1.e-8f;
float magSq = fNorm.MagnitudeSquared();
if( magSq < kMinMag )
return false;
if( fVerts.GetCount() < 3 )