mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-21 12:49:10 +00:00
Eliminate hsScalar and hsFixed
Modern CPUs support floats just fine... hsFixed was crazy.
This commit is contained in:
@ -140,7 +140,7 @@ hsVector3 plDynaWakeMgr::IGetDirection(const plDynaDecalInfo& info, const hsPoin
|
||||
{
|
||||
hsVector3 animDir;
|
||||
hsPoint3 p = pos;
|
||||
hsScalar t = fAnimPath->GetExtremePoint(p);
|
||||
float t = fAnimPath->GetExtremePoint(p);
|
||||
fAnimPath->SetCurTime(t, plAnimPath::kNone);
|
||||
|
||||
fAnimPath->GetVelocity(&animDir);
|
||||
@ -151,8 +151,8 @@ hsVector3 plDynaWakeMgr::IGetDirection(const plDynaDecalInfo& info, const hsPoin
|
||||
}
|
||||
|
||||
// Now if we want to factor in velocity, we can use (pos - info.fLastPos) / (hsTimer::GetSysSeconds() - info.fLastTime)
|
||||
hsScalar dt = hsScalar(hsTimer::GetSysSeconds() - info.fLastTime);
|
||||
const hsScalar kMinDt = 1.e-3f;
|
||||
float dt = float(hsTimer::GetSysSeconds() - info.fLastTime);
|
||||
const float kMinDt = 1.e-3f;
|
||||
if( (info.fFlags & plDynaDecalInfo::kImmersed) && (dt > kMinDt) )
|
||||
{
|
||||
hsVector3 velDir(&pos, &info.fLastPos);
|
||||
@ -177,10 +177,10 @@ hsBool plDynaWakeMgr::IRippleFromShape(const plPrintShape* shape, hsBool force)
|
||||
|
||||
const hsMatrix44& shapeL2W = shape->GetOwner()->GetLocalToWorld();
|
||||
|
||||
static hsScalar kMinDist = 1.0f;
|
||||
static hsScalar kMinTime = 0.25f;
|
||||
static float kMinDist = 1.0f;
|
||||
static float kMinTime = 0.25f;
|
||||
double t = hsTimer::GetSysSeconds();
|
||||
hsScalar dt = hsScalar(t - info.fLastTime) * sRand.RandZeroToOne();
|
||||
float dt = float(t - info.fLastTime) * sRand.RandZeroToOne();
|
||||
hsBool longEnough = (dt >= kMinTime);
|
||||
hsPoint3 xlate = shapeL2W.GetTranslate();
|
||||
hsBool farEnough = (hsVector3(&info.fLastPos, &xlate).Magnitude() > kMinDist);
|
||||
@ -197,19 +197,19 @@ hsBool plDynaWakeMgr::IRippleFromShape(const plPrintShape* shape, hsBool force)
|
||||
randPert.Normalize();
|
||||
if( !farEnough )
|
||||
{
|
||||
static hsScalar kRandPert = 0.05f;
|
||||
static float kRandPert = 0.05f;
|
||||
randPert *= kRandPert * shape->GetWidth();
|
||||
}
|
||||
else
|
||||
{
|
||||
static hsScalar kRandPert = 0.05f;
|
||||
static float kRandPert = 0.05f;
|
||||
randPert *= kRandPert * shape->GetWidth();
|
||||
}
|
||||
pos += randPert;
|
||||
|
||||
hsVector3 up(0.f, 0.f, 1.f);
|
||||
|
||||
static hsScalar kHeightScale = 1.f;
|
||||
static float kHeightScale = 1.f;
|
||||
pos.fZ += (shape->GetHeight() * fScale.fZ * kHeightScale) * 0.25f;
|
||||
|
||||
pos += dir * shape->GetLength() * 0.5f * (1.f - fScale.fY);
|
||||
|
Reference in New Issue
Block a user