mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-17 10:52:46 +00:00
Eliminate hsScalar and hsFixed
Modern CPUs support floats just fine... hsFixed was crazy.
This commit is contained in:
@ -743,7 +743,7 @@ plObjectInVolumeAndFacingDetector::~plObjectInVolumeAndFacingDetector()
|
||||
|
||||
void plObjectInVolumeAndFacingDetector::SetFacingTolerance(int degrees)
|
||||
{
|
||||
fFacingTolerance = hsCosine(hsScalarDegToRad(degrees));
|
||||
fFacingTolerance = cos(hsDegreesToRadians(degrees));
|
||||
}
|
||||
|
||||
void plObjectInVolumeAndFacingDetector::ICheckForTrigger()
|
||||
@ -760,7 +760,7 @@ void plObjectInVolumeAndFacingDetector::ICheckForTrigger()
|
||||
playerView.Normalize();
|
||||
objView.Normalize();
|
||||
|
||||
hsScalar dot = playerView * objView;
|
||||
float dot = playerView * objView;
|
||||
// hsStatusMessageF("Dot: %f Tolerance: %f", dot, fFacingTolerance);
|
||||
bool facing = dot >= fFacingTolerance;
|
||||
|
||||
@ -1075,7 +1075,7 @@ hsBool plSimpleRegionSensor::MsgReceive(plMessage *msg)
|
||||
}
|
||||
|
||||
// IEVAL
|
||||
hsBool plSimpleRegionSensor::IEval(double secs, hsScalar del, uint32_t dirty)
|
||||
hsBool plSimpleRegionSensor::IEval(double secs, float del, uint32_t dirty)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ public:
|
||||
class plObjectInVolumeAndFacingDetector : public plObjectInVolumeDetector
|
||||
{
|
||||
protected:
|
||||
hsScalar fFacingTolerance;
|
||||
float fFacingTolerance;
|
||||
bool fNeedWalkingForward;
|
||||
|
||||
bool fAvatarInVolume;
|
||||
@ -271,7 +271,7 @@ public:
|
||||
virtual void Write(hsStream *stream, hsResMgr *mgr);
|
||||
virtual void Read(hsStream *stream, hsResMgr *mgr);
|
||||
|
||||
virtual hsBool IEval(double secs, hsScalar del, uint32_t dirty);
|
||||
virtual hsBool IEval(double secs, float del, uint32_t dirty);
|
||||
protected:
|
||||
plMessage *fEnterMsg;
|
||||
plMessage *fExitMsg;
|
||||
|
@ -51,7 +51,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
class plDetectorModifier : public plSingleModifier
|
||||
{
|
||||
protected:
|
||||
virtual hsBool IEval(double secs, hsScalar del, uint32_t dirty){ return true; }
|
||||
virtual hsBool IEval(double secs, float del, uint32_t dirty){ return true; }
|
||||
|
||||
hsTArray<plKey> fReceivers;
|
||||
plModifier* fRemoteMod;
|
||||
|
@ -55,7 +55,7 @@ plPhysicalProxy::plPhysicalProxy()
|
||||
{
|
||||
}
|
||||
|
||||
plPhysicalProxy::plPhysicalProxy(const hsColorRGBA& amb, const hsColorRGBA& dif, hsScalar opac)
|
||||
plPhysicalProxy::plPhysicalProxy(const hsColorRGBA& amb, const hsColorRGBA& dif, float opac)
|
||||
: plProxyGen(amb, dif, opac),
|
||||
fOwner(nil),
|
||||
fController(nil)
|
||||
|
@ -53,7 +53,7 @@ class plPhysicalProxy : public plProxyGen
|
||||
{
|
||||
public:
|
||||
plPhysicalProxy();
|
||||
plPhysicalProxy(const hsColorRGBA& amb, const hsColorRGBA& dif, hsScalar opac);
|
||||
plPhysicalProxy(const hsColorRGBA& amb, const hsColorRGBA& dif, float opac);
|
||||
virtual ~plPhysicalProxy();
|
||||
|
||||
bool Init(plPhysical* phys);
|
||||
|
@ -171,7 +171,7 @@ void plPhysicalSndGroup::PlayImpactSound(uint32_t against)
|
||||
animMsg->Send(fImpactSounds[against]);
|
||||
}
|
||||
|
||||
void plPhysicalSndGroup::SetSlideSoundVolume(uint32_t against, hsScalar volume)
|
||||
void plPhysicalSndGroup::SetSlideSoundVolume(uint32_t against, float volume)
|
||||
{
|
||||
if(against >= fSlideSounds.Count())
|
||||
return;
|
||||
|
@ -88,7 +88,7 @@ public:
|
||||
void PlaySlideSound(uint32_t against);
|
||||
void StopSlideSound(uint32_t against);
|
||||
void PlayImpactSound(uint32_t against);
|
||||
void SetSlideSoundVolume(uint32_t against, hsScalar volume);
|
||||
void SetSlideSoundVolume(uint32_t against, float volume);
|
||||
bool HasSlideSound(uint32_t against);
|
||||
bool HasImpactSound(uint32_t against);
|
||||
|
||||
|
@ -88,7 +88,7 @@ void plPhysicsSoundMgr::Update()
|
||||
void plPhysicsSoundMgr::IStartCollision(const CollidePair& cp)
|
||||
{
|
||||
hsVector3 v1, v2;
|
||||
const hsScalar strengthThreshold = 20.0f;
|
||||
const float strengthThreshold = 20.0f;
|
||||
|
||||
plPhysical* physicalA = cp.FirstPhysical();
|
||||
plPhysical* physicalB = cp.SecondPhysical();
|
||||
@ -106,7 +106,7 @@ void plPhysicsSoundMgr::IStartCollision(const CollidePair& cp)
|
||||
physicalA->GetLinearVelocitySim(v1);
|
||||
physicalB->GetLinearVelocitySim(v2);
|
||||
hsVector3 vel = v1 - v2;
|
||||
hsScalar strength = vel.MagnitudeSquared();
|
||||
float strength = vel.MagnitudeSquared();
|
||||
|
||||
if (strength >= strengthThreshold)
|
||||
{
|
||||
@ -149,7 +149,7 @@ void plPhysicsSoundMgr::IStopCollision(const CollidePair& cp)
|
||||
|
||||
void plPhysicsSoundMgr::IUpdateCollision(const CollidePair& cp)
|
||||
{
|
||||
const hsScalar slideThreshhold = 0.f;
|
||||
const float slideThreshhold = 0.f;
|
||||
hsVector3 v1, v2;
|
||||
plPhysical* physicalA = cp.FirstPhysical();
|
||||
plPhysical* physicalB = cp.SecondPhysical();
|
||||
@ -162,7 +162,7 @@ void plPhysicsSoundMgr::IUpdateCollision(const CollidePair& cp)
|
||||
physicalA->GetLinearVelocitySim(v1);
|
||||
physicalB->GetLinearVelocitySim(v2);
|
||||
hsVector3 vel = v1 - v2;
|
||||
hsScalar strength = vel.MagnitudeSquared();
|
||||
float strength = vel.MagnitudeSquared();
|
||||
|
||||
// scale strength to use as volume
|
||||
strength /= 16*8;
|
||||
@ -175,7 +175,7 @@ void plPhysicsSoundMgr::IUpdateCollision(const CollidePair& cp)
|
||||
IProcessSlide(sndB, sndA, strength);
|
||||
}
|
||||
|
||||
void plPhysicsSoundMgr::IProcessSlide(plPhysicalSndGroup* sndA, plPhysicalSndGroup* sndB, hsScalar strength)
|
||||
void plPhysicsSoundMgr::IProcessSlide(plPhysicalSndGroup* sndA, plPhysicalSndGroup* sndB, float strength)
|
||||
{
|
||||
sndA->SetSlideSoundVolume(sndB->GetGroup(), strength);
|
||||
|
||||
|
@ -84,7 +84,7 @@ private:
|
||||
void IStartCollision(const CollidePair& cp);
|
||||
void IStopCollision(const CollidePair& cp);
|
||||
void IUpdateCollision(const CollidePair& cp);
|
||||
void IProcessSlide(plPhysicalSndGroup* sndA, plPhysicalSndGroup* sndB, hsScalar strength);
|
||||
void IProcessSlide(plPhysicalSndGroup* sndA, plPhysicalSndGroup* sndB, float strength);
|
||||
|
||||
typedef std::set<CollidePair> CollideSet;
|
||||
CollideSet fPrevCollisions;
|
||||
|
Reference in New Issue
Block a user