mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-18 11:19:10 +00:00
Merge remote-tracking branch 'origin/master' into plString
Conflicts: Sources/Plasma/CoreLib/hsStream.h Sources/Plasma/FeatureLib/pfAudio/plListener.cpp Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp Sources/Plasma/FeatureLib/pfConsole/pfDispatchLog.cpp Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp Sources/Plasma/FeatureLib/pfPython/cyMisc.h Sources/Plasma/FeatureLib/pfPython/cyMiscGlue4.cpp Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.h Sources/Plasma/FeatureLib/pfPython/pyImage.cpp Sources/Plasma/FeatureLib/pfPython/pyJournalBook.cpp Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfo.h Sources/Plasma/NucleusLib/pnKeyedObject/plFixedKey.cpp Sources/Plasma/NucleusLib/pnKeyedObject/plKeyImp.cpp Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.cpp Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.h Sources/Plasma/NucleusLib/pnMessage/plMessage.h Sources/Plasma/NucleusLib/pnNetCommon/plNetApp.h Sources/Plasma/PubUtilLib/plAvatar/plCoopCoordinator.cpp Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpansExport.cpp Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.cpp Sources/Plasma/PubUtilLib/plDrawable/plWaveSet7.cpp Sources/Plasma/PubUtilLib/plInputCore/plInputDevice.h Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.h Sources/Plasma/PubUtilLib/plNetCommon/plClientGuid.h Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.cpp Sources/Plasma/PubUtilLib/plNetMessage/plNetMsgHelpers.h Sources/Plasma/PubUtilLib/plNetTransport/plNetTransportMember.h Sources/Plasma/PubUtilLib/plPhysX/plSimulationMgr.cpp Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp Sources/Plasma/PubUtilLib/plPipeline/plPlates.cpp Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.cpp Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.h Sources/Plasma/PubUtilLib/plResMgr/plRegistryNode.cpp Sources/Plasma/PubUtilLib/plResMgr/plRegistryNode.h Sources/Plasma/PubUtilLib/plScene/plRelevanceMgr.cpp Sources/Plasma/PubUtilLib/plScene/plRelevanceMgr.h Sources/Plasma/PubUtilLib/plSurface/plGrassShaderMod.cpp
This commit is contained in:
@ -39,7 +39,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "hsTypes.h"
|
||||
#include "HeadSpin.h"
|
||||
#include "hsStlUtils.h"
|
||||
#include "hsMatrix44.h"
|
||||
#include "hsGeometry3.h"
|
||||
@ -496,7 +496,7 @@ pfBoid::~pfBoid()
|
||||
// delete this boid's token in the proximity database
|
||||
delete fProximityToken;
|
||||
|
||||
plLoadCloneMsg* msg = TRACKED_NEW plLoadCloneMsg(fObjKey, fFlockerPtr->GetKey(), 0, false);
|
||||
plLoadCloneMsg* msg = new plLoadCloneMsg(fObjKey, fFlockerPtr->GetKey(), 0, false);
|
||||
msg->Send();
|
||||
}
|
||||
|
||||
@ -790,7 +790,7 @@ fMaxForce(10.0f),
|
||||
fMaxSpeed(5.0f),
|
||||
fMinSpeed(4.0f)
|
||||
{
|
||||
fDatabase = TRACKED_NEW pfBasicProximityDatabase<pfVehicle*>();
|
||||
fDatabase = new pfBasicProximityDatabase<pfVehicle*>();
|
||||
}
|
||||
|
||||
pfFlock::~pfFlock()
|
||||
@ -886,7 +886,7 @@ void pfFlock::Update(plSceneObject *goal, float deltaTime)
|
||||
|
||||
void pfFlock::AddBoid(pfObjectFlocker *flocker, plKey &key, hsPoint3 &pos)
|
||||
{
|
||||
pfBoid *newBoid = TRACKED_NEW pfBoid(*fDatabase, flocker, key, pos);
|
||||
pfBoid *newBoid = new pfBoid(*fDatabase, flocker, key, pos);
|
||||
|
||||
newBoid->SetGoalWeight(fGoalWeight);
|
||||
newBoid->SetWanderWeight(fRandomWeight);
|
||||
@ -924,7 +924,7 @@ pfObjectFlocker::~pfObjectFlocker()
|
||||
plgDispatch::Dispatch()->UnRegisterForExactType(plEvalMsg::Index(), GetKey());
|
||||
}
|
||||
|
||||
void pfObjectFlocker::SetNumBoids(UInt8 val)
|
||||
void pfObjectFlocker::SetNumBoids(uint8_t val)
|
||||
{
|
||||
fNumBoids = val;
|
||||
}
|
||||
@ -934,7 +934,7 @@ hsBool pfObjectFlocker::MsgReceive(plMessage* msg)
|
||||
plInitialAgeStateLoadedMsg* loadMsg = plInitialAgeStateLoadedMsg::ConvertNoRef(msg);
|
||||
if (loadMsg)
|
||||
{
|
||||
plEnableMsg* pMsg = TRACKED_NEW plEnableMsg;
|
||||
plEnableMsg* pMsg = new plEnableMsg;
|
||||
pMsg->AddReceiver(fBoidKey);
|
||||
pMsg->SetCmd(plEnableMsg::kDrawable);
|
||||
pMsg->AddType(plEnableMsg::kDrawable);
|
||||
@ -945,13 +945,13 @@ hsBool pfObjectFlocker::MsgReceive(plMessage* msg)
|
||||
hsPoint3 pos(fTarget->GetLocalToWorld().GetTranslate());
|
||||
for (int i = 0; i < fNumBoids; i++)
|
||||
{
|
||||
plLoadCloneMsg* cloneMsg = TRACKED_NEW plLoadCloneMsg(fBoidKey->GetUoid(), GetKey(), 0);
|
||||
plLoadCloneMsg* cloneMsg = new plLoadCloneMsg(fBoidKey->GetUoid(), GetKey(), 0);
|
||||
plKey newKey = cloneMsg->GetCloneKey();
|
||||
cloneMsg->Send();
|
||||
|
||||
hsScalar xAdjust = (2 * RAND()) - 1; // produces a random number between -1 and 1
|
||||
hsScalar yAdjust = (2 * RAND()) - 1;
|
||||
hsScalar zAdjust = (2 * RAND()) - 1;
|
||||
float xAdjust = (2 * RAND()) - 1; // produces a random number between -1 and 1
|
||||
float yAdjust = (2 * RAND()) - 1;
|
||||
float zAdjust = (2 * RAND()) - 1;
|
||||
hsPoint3 boidPos(pos.fX + xAdjust, pos.fY + yAdjust, pos.fZ + zAdjust);
|
||||
fFlock.AddBoid(this, newKey, boidPos);
|
||||
}
|
||||
@ -966,7 +966,7 @@ hsBool pfObjectFlocker::MsgReceive(plMessage* msg)
|
||||
{
|
||||
if (fRandomizeAnimationStart)
|
||||
{
|
||||
plAnimCmdMsg* pMsg = TRACKED_NEW plAnimCmdMsg;
|
||||
plAnimCmdMsg* pMsg = new plAnimCmdMsg;
|
||||
pMsg->SetSender(GetKey());
|
||||
pMsg->SetBCastFlag(plMessage::kPropagateToModifiers | plMessage::kPropagateToChildren);
|
||||
pMsg->AddReceiver( lcMsg->GetCloneKey() );
|
||||
@ -979,7 +979,7 @@ hsBool pfObjectFlocker::MsgReceive(plMessage* msg)
|
||||
return plSingleModifier::MsgReceive(msg);
|
||||
}
|
||||
|
||||
hsBool pfObjectFlocker::IEval(double secs, hsScalar del, UInt32 dirty)
|
||||
hsBool pfObjectFlocker::IEval(double secs, float del, uint32_t dirty)
|
||||
{
|
||||
fFlock.Update(fTarget, del);
|
||||
|
||||
|
@ -126,7 +126,7 @@ public:
|
||||
virtual ~pfBasicProximityDatabase() {}
|
||||
|
||||
// allocate a token to represent a given client object in this database
|
||||
tokenType *MakeToken(T parentObject) {return TRACKED_NEW tokenType(parentObject, fGroup);}
|
||||
tokenType *MakeToken(T parentObject) {return new tokenType(parentObject, fGroup);}
|
||||
|
||||
// return the number of tokens currently in the database
|
||||
int Size(void) {return fGroup.size();}
|
||||
@ -408,7 +408,7 @@ public:
|
||||
virtual void Read(hsStream* stream, hsResMgr* mgr);
|
||||
virtual void Write(hsStream* stream, hsResMgr* mgr);
|
||||
|
||||
void SetNumBoids(UInt8 val);
|
||||
void SetNumBoids(uint8_t val);
|
||||
void SetBoidKey(plKey key) { fBoidKey = key; }
|
||||
|
||||
float GoalWeight() const {return fFlock.GoalWeight();}
|
||||
@ -448,7 +448,7 @@ protected:
|
||||
hsBool fUseTargetRotation;
|
||||
hsBool fRandomizeAnimationStart;
|
||||
|
||||
virtual hsBool IEval(double secs, hsScalar del, UInt32 dirty);
|
||||
virtual hsBool IEval(double secs, float del, uint32_t dirty);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -40,7 +40,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#include "hsTypes.h"
|
||||
#include "HeadSpin.h"
|
||||
#include "plBlower.h"
|
||||
#include "plgDispatch.h"
|
||||
#include "hsFastMath.h"
|
||||
@ -51,13 +51,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
plRandom plBlower::fRandom;
|
||||
|
||||
static const hsScalar kDefaultMasterPower = 20.f;
|
||||
static const hsScalar kDefaultMasterFrequency = 2.f;
|
||||
static const hsScalar kDefaultDirectRate = 1.f;
|
||||
static const hsScalar kDefaultImpulseRate = 1.e2f;
|
||||
static const hsScalar kDefaultSpringKonst = 20.f;
|
||||
static const hsScalar kDefaultBias = 0.25f;
|
||||
static const hsScalar kInitialMaxOffDist = 1.f;
|
||||
static const float kDefaultMasterPower = 20.f;
|
||||
static const float kDefaultMasterFrequency = 2.f;
|
||||
static const float kDefaultDirectRate = 1.f;
|
||||
static const float kDefaultImpulseRate = 1.e2f;
|
||||
static const float kDefaultSpringKonst = 20.f;
|
||||
static const float kDefaultBias = 0.25f;
|
||||
static const float kInitialMaxOffDist = 1.f;
|
||||
|
||||
plBlower::plBlower()
|
||||
:
|
||||
@ -82,7 +82,7 @@ plBlower::~plBlower()
|
||||
{
|
||||
}
|
||||
|
||||
void plBlower::IBlow(double secs, hsScalar delSecs)
|
||||
void plBlower::IBlow(double secs, float delSecs)
|
||||
{
|
||||
hsPoint3 worldPos = fTarget->GetLocalToWorld().GetTranslate();
|
||||
hsPoint3 localPos = fTarget->GetLocalToParent().GetTranslate();
|
||||
@ -93,13 +93,13 @@ void plBlower::IBlow(double secs, hsScalar delSecs)
|
||||
|
||||
// Strength = Strength + rnd01 * (MaxStrength - Strength)
|
||||
|
||||
hsScalar t = (fAccumTime += delSecs);
|
||||
float t = (fAccumTime += delSecs);
|
||||
|
||||
hsScalar strength = 0;
|
||||
float strength = 0;
|
||||
int i;
|
||||
for( i = 0; i < fOscillators.GetCount(); i++ )
|
||||
{
|
||||
hsScalar c, s;
|
||||
float c, s;
|
||||
t *= fOscillators[i].fFrequency * fMasterFrequency;
|
||||
t += fOscillators[i].fPhase;
|
||||
hsFastMath::SinCosAppr(t, s, c);
|
||||
@ -116,25 +116,25 @@ void plBlower::IBlow(double secs, hsScalar delSecs)
|
||||
|
||||
hsFastMath::NormalizeAppr(fDirection);
|
||||
|
||||
hsScalar offDist = hsVector3(&fRestPos, &worldPos).Magnitude();
|
||||
float offDist = hsVector3(&fRestPos, &worldPos).Magnitude();
|
||||
if( offDist > fMaxOffsetDist )
|
||||
fMaxOffsetDist = offDist;
|
||||
|
||||
hsVector3 force = fDirection * strength;
|
||||
|
||||
static hsScalar kOffsetDistFrac = 0.5f; // make me const
|
||||
static float kOffsetDistFrac = 0.5f; // make me const
|
||||
if( offDist > fMaxOffsetDist * kOffsetDistFrac )
|
||||
{
|
||||
offDist /= fMaxOffsetDist;
|
||||
offDist *= fMasterPower;
|
||||
|
||||
hsScalar impulse = offDist * delSecs * fImpulseRate;
|
||||
float impulse = offDist * delSecs * fImpulseRate;
|
||||
|
||||
force.fX += impulse * fRandom.RandMinusOneToOne();
|
||||
force.fY += impulse * fRandom.RandMinusOneToOne();
|
||||
force.fZ += impulse * fRandom.RandMinusOneToOne();
|
||||
}
|
||||
const hsScalar kOffsetDistDecay = 0.999f;
|
||||
const float kOffsetDistDecay = 0.999f;
|
||||
fMaxOffsetDist *= kOffsetDistDecay;
|
||||
|
||||
hsVector3 accel = force;
|
||||
@ -145,9 +145,9 @@ void plBlower::IBlow(double secs, hsScalar delSecs)
|
||||
fCurrDel = del;
|
||||
}
|
||||
|
||||
hsBool plBlower::IEval(double secs, hsScalar delSecs, UInt32 dirty)
|
||||
hsBool plBlower::IEval(double secs, float delSecs, uint32_t dirty)
|
||||
{
|
||||
const hsScalar kMaxDelSecs = 0.1f;
|
||||
const float kMaxDelSecs = 0.1f;
|
||||
if( delSecs > kMaxDelSecs )
|
||||
delSecs = kMaxDelSecs;
|
||||
IBlow(secs, delSecs);
|
||||
@ -212,20 +212,20 @@ void plBlower::Write(hsStream* s, hsResMgr* mgr)
|
||||
|
||||
void plBlower::IInitOscillators()
|
||||
{
|
||||
const hsScalar kBasePower = 5.f;
|
||||
const float kBasePower = 5.f;
|
||||
fOscillators.SetCount(5);
|
||||
int i;
|
||||
for( i = 0; i < fOscillators.GetCount(); i++ )
|
||||
{
|
||||
hsScalar fi = hsScalar(i+1);
|
||||
fOscillators[i].fFrequency = fi / hsScalarPI * fRandom.RandRangeF(0.75f, 1.25f);
|
||||
// fOscillators[i].fFrequency = 1.f / hsScalarPI * fRandom.RandRangeF(0.5f, 1.5f);
|
||||
float fi = float(i+1);
|
||||
fOscillators[i].fFrequency = fi / M_PI * fRandom.RandRangeF(0.75f, 1.25f);
|
||||
// fOscillators[i].fFrequency = 1.f / M_PI * fRandom.RandRangeF(0.5f, 1.5f);
|
||||
fOscillators[i].fPhase = fRandom.RandZeroToOne();
|
||||
fOscillators[i].fPower = kBasePower * fRandom.RandRangeF(0.75f, 1.25f);
|
||||
}
|
||||
}
|
||||
|
||||
void plBlower::SetConstancy(hsScalar f)
|
||||
void plBlower::SetConstancy(float f)
|
||||
{
|
||||
if( f < 0 )
|
||||
f = 0;
|
||||
@ -235,7 +235,7 @@ void plBlower::SetConstancy(hsScalar f)
|
||||
fBias = f;
|
||||
}
|
||||
|
||||
hsScalar plBlower::GetConstancy() const
|
||||
float plBlower::GetConstancy() const
|
||||
{
|
||||
return fBias;
|
||||
}
|
||||
|
@ -58,21 +58,21 @@ protected:
|
||||
class Oscillator
|
||||
{
|
||||
public:
|
||||
hsScalar fFrequency;
|
||||
hsScalar fPhase;
|
||||
hsScalar fPower;
|
||||
float fFrequency;
|
||||
float fPhase;
|
||||
float fPower;
|
||||
};
|
||||
static plRandom fRandom;
|
||||
|
||||
// Parameters
|
||||
hsScalar fMasterPower;
|
||||
hsScalar fMasterFrequency;
|
||||
hsScalar fDirectRate;
|
||||
hsScalar fImpulseRate;
|
||||
hsScalar fSpringKonst;
|
||||
hsScalar fBias;
|
||||
float fMasterPower;
|
||||
float fMasterFrequency;
|
||||
float fDirectRate;
|
||||
float fImpulseRate;
|
||||
float fSpringKonst;
|
||||
float fBias;
|
||||
|
||||
hsScalar fAccumTime;
|
||||
float fAccumTime;
|
||||
hsTArray<Oscillator> fOscillators;
|
||||
|
||||
// CurrentState
|
||||
@ -80,13 +80,13 @@ protected:
|
||||
hsPoint3 fRestPos;
|
||||
hsPoint3 fLocalRestPos;
|
||||
hsVector3 fCurrDel;
|
||||
hsScalar fMaxOffsetDist;
|
||||
float fMaxOffsetDist;
|
||||
|
||||
void IInitOscillators();
|
||||
void ISetTargetTransform();
|
||||
void IBlow(double secs, hsScalar delSecs);
|
||||
void IBlow(double secs, float delSecs);
|
||||
|
||||
virtual hsBool IEval(double secs, hsScalar del, UInt32 dirty);
|
||||
virtual hsBool IEval(double secs, float del, uint32_t dirty);
|
||||
public:
|
||||
~plBlower();
|
||||
plBlower();
|
||||
@ -99,19 +99,19 @@ public:
|
||||
virtual void Read(hsStream* stream, hsResMgr* mgr);
|
||||
virtual void Write(hsStream* stream, hsResMgr* mgr);
|
||||
|
||||
void SetMasterPower(hsScalar f) { fMasterPower = f; }
|
||||
void SetMasterFrequency(hsScalar f) { fMasterFrequency = f; }
|
||||
void SetDirectRate(hsScalar f) { fDirectRate = f; }
|
||||
void SetImpulseRate(hsScalar f) { fImpulseRate = f; }
|
||||
void SetSpringKonst(hsScalar f) { fSpringKonst = f; }
|
||||
void SetConstancy(hsScalar f);
|
||||
void SetMasterPower(float f) { fMasterPower = f; }
|
||||
void SetMasterFrequency(float f) { fMasterFrequency = f; }
|
||||
void SetDirectRate(float f) { fDirectRate = f; }
|
||||
void SetImpulseRate(float f) { fImpulseRate = f; }
|
||||
void SetSpringKonst(float f) { fSpringKonst = f; }
|
||||
void SetConstancy(float f);
|
||||
|
||||
hsScalar GetMasterPower() const { return fMasterPower; }
|
||||
hsScalar GetMasterFrequency() const { return fMasterFrequency; }
|
||||
hsScalar GetDirectRate() const { return fDirectRate; }
|
||||
hsScalar GetImpulseRate() const { return fImpulseRate; }
|
||||
hsScalar GetSpringKonst() const { return fSpringKonst; }
|
||||
hsScalar GetConstancy() const;
|
||||
float GetMasterPower() const { return fMasterPower; }
|
||||
float GetMasterFrequency() const { return fMasterFrequency; }
|
||||
float GetDirectRate() const { return fDirectRate; }
|
||||
float GetImpulseRate() const { return fImpulseRate; }
|
||||
float GetSpringKonst() const { return fSpringKonst; }
|
||||
float GetConstancy() const;
|
||||
};
|
||||
|
||||
#endif // plBlower_inc
|
||||
|
@ -40,7 +40,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#include "hsTypes.h"
|
||||
#include "HeadSpin.h"
|
||||
#include "plFilterCoordInterface.h"
|
||||
|
||||
#include "hsMatrix44.h"
|
||||
@ -50,7 +50,7 @@ static hsMatrix44* InvTRS(const hsMatrix44& trs, hsMatrix44& inv)
|
||||
{
|
||||
inv.NotIdentity();
|
||||
|
||||
hsScalar invSSq[3];
|
||||
float invSSq[3];
|
||||
invSSq[0] = 1.f / (trs.fMap[0][0] * trs.fMap[0][0] + trs.fMap[1][0] * trs.fMap[1][0] + trs.fMap[2][0] * trs.fMap[2][0]);
|
||||
invSSq[1] = 1.f / (trs.fMap[0][1] * trs.fMap[0][1] + trs.fMap[1][1] * trs.fMap[1][1] + trs.fMap[2][1] * trs.fMap[2][1]);
|
||||
invSSq[2] = 1.f / (trs.fMap[0][2] * trs.fMap[0][2] + trs.fMap[1][2] * trs.fMap[1][2] + trs.fMap[2][2] * trs.fMap[2][2]);
|
||||
|
@ -58,7 +58,7 @@ public:
|
||||
kNoNothing = kNoRotation | kNoMove
|
||||
};
|
||||
protected:
|
||||
UInt32 fFilterMask;
|
||||
uint32_t fFilterMask;
|
||||
hsMatrix44 fRefParentLocalToWorld;
|
||||
|
||||
virtual void IRecalcTransforms();
|
||||
@ -73,8 +73,8 @@ public:
|
||||
virtual void Write(hsStream* stream, hsResMgr* mgr);
|
||||
|
||||
|
||||
void SetFilterMask(UInt32 f) { fFilterMask = f; }
|
||||
UInt32 GetFilterMask() const { return fFilterMask; }
|
||||
void SetFilterMask(uint32_t f) { fFilterMask = f; }
|
||||
uint32_t GetFilterMask() const { return fFilterMask; }
|
||||
|
||||
void SetRefLocalToWorld(const hsMatrix44& m) { fRefParentLocalToWorld = m; }
|
||||
const hsMatrix44& GetRefLocalToWorld() const { return fRefParentLocalToWorld; }
|
||||
|
@ -40,7 +40,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#include "hsTypes.h"
|
||||
#include "HeadSpin.h"
|
||||
#include "plFollowMod.h"
|
||||
#include "plgDispatch.h"
|
||||
#include "pnNetCommon/plNetApp.h"
|
||||
@ -218,7 +218,7 @@ void plFollowMod::IMoveTarget()
|
||||
GetTarget()->SetTransform(l2w, w2l);
|
||||
}
|
||||
|
||||
hsBool plFollowMod::IEval(double secs, hsScalar del, UInt32 dirty)
|
||||
hsBool plFollowMod::IEval(double secs, float del, uint32_t dirty)
|
||||
{
|
||||
if( ICheckLeader() )
|
||||
IMoveTarget();
|
||||
@ -281,7 +281,7 @@ void plFollowMod::Read(hsStream* stream, hsResMgr* mgr)
|
||||
fLeaderType = FollowLeaderType(stream->ReadByte());
|
||||
fMode = stream->ReadByte();
|
||||
|
||||
mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefLeader), plRefFlags::kActiveRef);
|
||||
mgr->ReadKeyNotifyMe(stream, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefLeader), plRefFlags::kActiveRef);
|
||||
|
||||
// If active?
|
||||
Activate();
|
||||
|
@ -76,8 +76,8 @@ public:
|
||||
};
|
||||
protected:
|
||||
FollowLeaderType fLeaderType;
|
||||
UInt8 fMode;
|
||||
UInt8 fLeaderSet;
|
||||
uint8_t fMode;
|
||||
uint8_t fLeaderSet;
|
||||
|
||||
plSceneObject* fLeader; // may be nil if Leader isn't a sceneobject
|
||||
|
||||
@ -87,7 +87,7 @@ protected:
|
||||
hsBool ICheckLeader();
|
||||
void IMoveTarget();
|
||||
|
||||
virtual hsBool IEval(double secs, hsScalar del, UInt32 dirty);
|
||||
virtual hsBool IEval(double secs, float del, uint32_t dirty);
|
||||
|
||||
public:
|
||||
plFollowMod();
|
||||
@ -106,8 +106,8 @@ public:
|
||||
void SetType(FollowLeaderType t) { fLeaderType = t; }
|
||||
FollowLeaderType GetType() const { return fLeaderType; }
|
||||
|
||||
void SetMode(UInt8 m) { fMode = m; }
|
||||
UInt8 GetMode() const { return fMode; }
|
||||
void SetMode(uint8_t m) { fMode = m; }
|
||||
uint8_t GetMode() const { return fMode; }
|
||||
|
||||
void Activate();
|
||||
void Deactivate();
|
||||
|
@ -40,7 +40,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#include "hsTypes.h"
|
||||
#include "HeadSpin.h"
|
||||
#include "plLightModifier.h"
|
||||
#include "plGLight/plLightInfo.h"
|
||||
#include "plInterp/plController.h"
|
||||
@ -141,7 +141,7 @@ void plLightModifier::IApplyDynamic()
|
||||
|
||||
void plLightModifier::DefaultAnimation()
|
||||
{
|
||||
hsScalar len = MaxAnimLength(0);
|
||||
float len = MaxAnimLength(0);
|
||||
fTimeConvert.SetBegin(0);
|
||||
fTimeConvert.SetEnd(len);
|
||||
fTimeConvert.SetLoopPoints(0, len);
|
||||
@ -149,7 +149,7 @@ void plLightModifier::DefaultAnimation()
|
||||
fTimeConvert.Start();
|
||||
}
|
||||
|
||||
hsScalar plLightModifier::MaxAnimLength(hsScalar len) const
|
||||
float plLightModifier::MaxAnimLength(float len) const
|
||||
{
|
||||
if( fColorCtl && (fColorCtl->GetLength() > len) )
|
||||
len = fColorCtl->GetLength();
|
||||
@ -229,7 +229,7 @@ void plOmniModifier::IApplyDynamic()
|
||||
}
|
||||
}
|
||||
|
||||
hsScalar plOmniModifier::MaxAnimLength(hsScalar len) const
|
||||
float plOmniModifier::MaxAnimLength(float len) const
|
||||
{
|
||||
len = plLightModifier::MaxAnimLength(len);
|
||||
if( fAttenCtl && (fAttenCtl->GetLength() > len) )
|
||||
@ -302,20 +302,20 @@ void plSpotModifier::IApplyDynamic()
|
||||
{
|
||||
plOmniModifier::IApplyDynamic();
|
||||
|
||||
hsScalar f;
|
||||
float f;
|
||||
if( fInnerCtl )
|
||||
{
|
||||
fInnerCtl->Interp(fCurrentTime, &f);
|
||||
fSpot->SetSpotInner(hsScalarDegToRad(f)*0.5f);
|
||||
fSpot->SetSpotInner(hsDegreesToRadians(f)*0.5f);
|
||||
}
|
||||
if( fOuterCtl )
|
||||
{
|
||||
fOuterCtl->Interp(fCurrentTime, &f);
|
||||
fSpot->SetSpotOuter(hsScalarDegToRad(f)*0.5f);
|
||||
fSpot->SetSpotOuter(hsDegreesToRadians(f)*0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
hsScalar plSpotModifier::MaxAnimLength(hsScalar len) const
|
||||
float plSpotModifier::MaxAnimLength(float len) const
|
||||
{
|
||||
len = plOmniModifier::MaxAnimLength(len);
|
||||
if( fInnerCtl && (fInnerCtl->GetLength() > len) )
|
||||
@ -397,7 +397,7 @@ void plLtdDirModifier::IApplyDynamic()
|
||||
{
|
||||
plLightModifier::IApplyDynamic();
|
||||
|
||||
hsScalar f;
|
||||
float f;
|
||||
if( fWidthCtl )
|
||||
{
|
||||
fWidthCtl->Interp(fCurrentTime, &f);
|
||||
@ -415,7 +415,7 @@ void plLtdDirModifier::IApplyDynamic()
|
||||
}
|
||||
}
|
||||
|
||||
hsScalar plLtdDirModifier::MaxAnimLength(hsScalar len) const
|
||||
float plLtdDirModifier::MaxAnimLength(float len) const
|
||||
{
|
||||
len = plLightModifier::MaxAnimLength(len);
|
||||
if( fWidthCtl && (fWidthCtl->GetLength() > len) )
|
||||
|
@ -87,7 +87,7 @@ public:
|
||||
void SetSpecularCtl(plController* ctl) { fSpecularCtl = ctl; }
|
||||
|
||||
virtual void DefaultAnimation();
|
||||
virtual hsScalar MaxAnimLength(hsScalar len) const;
|
||||
virtual float MaxAnimLength(float len) const;
|
||||
};
|
||||
|
||||
class plOmniModifier : public plLightModifier
|
||||
@ -121,7 +121,7 @@ public:
|
||||
void SetAttenCtl(plController* ctl) { fAttenCtl = ctl; }
|
||||
void SetInitAtten(const hsPoint3& p) { fInitAtten = p; }
|
||||
|
||||
virtual hsScalar MaxAnimLength(hsScalar len) const;
|
||||
virtual float MaxAnimLength(float len) const;
|
||||
};
|
||||
|
||||
class plSpotModifier : public plOmniModifier
|
||||
@ -155,7 +155,7 @@ public:
|
||||
void SetInnerCtl(plController* ctl) { fInnerCtl = ctl; }
|
||||
void SetOuterCtl(plController* ctl) { fOuterCtl = ctl; }
|
||||
|
||||
virtual hsScalar MaxAnimLength(hsScalar len) const;
|
||||
virtual float MaxAnimLength(float len) const;
|
||||
};
|
||||
|
||||
class plLtdDirModifier : public plLightModifier
|
||||
@ -191,7 +191,7 @@ public:
|
||||
void SetHeightCtl(plController* ctl) { fHeightCtl = ctl; }
|
||||
void SetDepthCtl(plController* ctl) { fDepthCtl = ctl; }
|
||||
|
||||
virtual hsScalar MaxAnimLength(hsScalar len) const;
|
||||
virtual float MaxAnimLength(float len) const;
|
||||
};
|
||||
|
||||
#endif // plLightModifier_inc
|
||||
|
@ -40,7 +40,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#include "hsTypes.h"
|
||||
#include "HeadSpin.h"
|
||||
#include "plLineFollowMod.h"
|
||||
#include "plStereizer.h"
|
||||
#include "plInterp/plAnimPath.h"
|
||||
@ -79,7 +79,7 @@ plLineFollowMod::~plLineFollowMod()
|
||||
delete fPath;
|
||||
}
|
||||
|
||||
void plLineFollowMod::SetSpeedClamp(hsScalar fps)
|
||||
void plLineFollowMod::SetSpeedClamp(float fps)
|
||||
{
|
||||
fSpeedClamp = fps;
|
||||
if( fSpeedClamp > 0 )
|
||||
@ -93,7 +93,7 @@ void plLineFollowMod::SetSpeedClamp(hsScalar fps)
|
||||
|
||||
}
|
||||
|
||||
void plLineFollowMod::SetOffsetFeet(hsScalar f)
|
||||
void plLineFollowMod::SetOffsetFeet(float f)
|
||||
{
|
||||
fOffset = f;
|
||||
if( fOffset != 0 )
|
||||
@ -115,9 +115,9 @@ void plLineFollowMod::SetForceToLine(hsBool on)
|
||||
fFollowFlags &= ~kForceToLine;
|
||||
}
|
||||
|
||||
void plLineFollowMod::SetOffsetDegrees(hsScalar f)
|
||||
void plLineFollowMod::SetOffsetDegrees(float f)
|
||||
{
|
||||
fOffset = hsScalarDegToRad(f);
|
||||
fOffset = hsDegreesToRadians(f);
|
||||
if( fOffset != 0 )
|
||||
{
|
||||
fFollowFlags &= ~kOffsetFeet;
|
||||
@ -130,7 +130,7 @@ void plLineFollowMod::SetOffsetDegrees(hsScalar f)
|
||||
}
|
||||
}
|
||||
|
||||
void plLineFollowMod::SetOffsetClamp(hsScalar f)
|
||||
void plLineFollowMod::SetOffsetClamp(float f)
|
||||
{
|
||||
fOffsetClamp = f;
|
||||
if( fOffsetClamp > 0 )
|
||||
@ -155,20 +155,20 @@ void plLineFollowMod::Read(hsStream* stream, hsResMgr* mgr)
|
||||
|
||||
fPath = plAnimPath::ConvertNoRef(mgr->ReadCreatable(stream));
|
||||
|
||||
mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefParent), plRefFlags::kPassiveRef);
|
||||
mgr->ReadKeyNotifyMe(stream, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefParent), plRefFlags::kPassiveRef);
|
||||
|
||||
mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefObject), plRefFlags::kPassiveRef);
|
||||
mgr->ReadKeyNotifyMe(stream, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefObject), plRefFlags::kPassiveRef);
|
||||
|
||||
int n = stream->ReadLE32();
|
||||
while(n--)
|
||||
{
|
||||
mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefStereizer), plRefFlags::kPassiveRef);
|
||||
mgr->ReadKeyNotifyMe(stream, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefStereizer), plRefFlags::kPassiveRef);
|
||||
}
|
||||
|
||||
UInt32 f = stream->ReadLE32();
|
||||
uint32_t f = stream->ReadLE32();
|
||||
SetFollowMode(FollowMode(f & 0xffff));
|
||||
|
||||
fFollowFlags = (UInt16)((f >> 16) & 0xffff);
|
||||
fFollowFlags = (uint16_t)((f >> 16) & 0xffff);
|
||||
|
||||
if( fFollowFlags & kOffset )
|
||||
{
|
||||
@ -203,7 +203,7 @@ void plLineFollowMod::Write(hsStream* stream, hsResMgr* mgr)
|
||||
for( i = 0; i < fStereizers.GetCount(); i++ )
|
||||
mgr->WriteKey(stream, fStereizers[i]->GetKey());
|
||||
|
||||
UInt32 f = UInt32(fFollowMode) | (UInt32(fFollowFlags) << 16);
|
||||
uint32_t f = uint32_t(fFollowMode) | (uint32_t(fFollowFlags) << 16);
|
||||
stream->WriteLE32(f);
|
||||
|
||||
if( fFollowFlags & kOffset )
|
||||
@ -337,7 +337,7 @@ void plLineFollowMod::IRegister()
|
||||
}
|
||||
}
|
||||
|
||||
hsBool plLineFollowMod::IEval(double secs, hsScalar del, UInt32 dirty)
|
||||
hsBool plLineFollowMod::IEval(double secs, float del, uint32_t dirty)
|
||||
{
|
||||
if( !fPath )
|
||||
return false;
|
||||
@ -366,7 +366,7 @@ hsBool plLineFollowMod::IOffsetTargetTransform(hsMatrix44& tgtXfm)
|
||||
hsPoint3 tgtPos = tgtXfm.GetTranslate();
|
||||
|
||||
hsVector3 tgt2src(&fSearchPos, &tgtPos);
|
||||
hsScalar t2sLen = tgt2src.Magnitude();
|
||||
float t2sLen = tgt2src.Magnitude();
|
||||
hsFastMath::NormalizeAppr(tgt2src);
|
||||
|
||||
hsVector3 out;
|
||||
@ -374,7 +374,7 @@ hsBool plLineFollowMod::IOffsetTargetTransform(hsMatrix44& tgtXfm)
|
||||
|
||||
if( fFollowFlags & kOffsetAng )
|
||||
{
|
||||
hsScalar del = t2sLen * fTanOffset;
|
||||
float del = t2sLen * fTanOffset;
|
||||
if( fFollowFlags & kOffsetClamp )
|
||||
{
|
||||
if( del > fOffsetClamp )
|
||||
@ -409,7 +409,7 @@ hsBool plLineFollowMod::IOffsetTargetTransform(hsMatrix44& tgtXfm)
|
||||
|
||||
hsBool plLineFollowMod::IGetTargetTransform(hsPoint3& searchPos, hsMatrix44& tgtXfm)
|
||||
{
|
||||
hsScalar t = fPath->GetExtremePoint(searchPos);
|
||||
float t = fPath->GetExtremePoint(searchPos);
|
||||
if( fFollowFlags & kFullMatrix )
|
||||
{
|
||||
fPath->SetCurTime(t, plAnimPath::kNone);
|
||||
@ -441,12 +441,12 @@ void plLineFollowMod::ICheckForPop(const hsPoint3& oldPos, const hsPoint3& newPo
|
||||
{
|
||||
hsVector3 del(&oldPos, &newPos);
|
||||
|
||||
hsScalar elapsed = hsTimer::GetDelSysSeconds();
|
||||
hsScalar speedSq = 0.f;
|
||||
float elapsed = hsTimer::GetDelSysSeconds();
|
||||
float speedSq = 0.f;
|
||||
if (elapsed > 0.f)
|
||||
speedSq = del.MagnitudeSquared() / elapsed;
|
||||
|
||||
const hsScalar kMaxSpeedSq = 30.f * 30.f; // (feet per sec)^2
|
||||
const float kMaxSpeedSq = 30.f * 30.f; // (feet per sec)^2
|
||||
if( speedSq > kMaxSpeedSq )
|
||||
fFollowFlags |= kSearchPosPop;
|
||||
else
|
||||
@ -497,7 +497,7 @@ hsBool plLineFollowMod::IGetSearchPos()
|
||||
return true;
|
||||
}
|
||||
|
||||
hsMatrix44 plLineFollowMod::IInterpMatrices(const hsMatrix44& m0, const hsMatrix44& m1, hsScalar parm)
|
||||
hsMatrix44 plLineFollowMod::IInterpMatrices(const hsMatrix44& m0, const hsMatrix44& m1, float parm)
|
||||
{
|
||||
hsMatrix44 retVal;
|
||||
int i, j;
|
||||
@ -524,14 +524,14 @@ hsMatrix44 plLineFollowMod::ISpeedClamp(plCoordinateInterface* ci, const hsMatri
|
||||
const hsPoint3 oldPos = currL2W.GetTranslate();
|
||||
const hsPoint3 newPos = unclTgtXfm.GetTranslate();
|
||||
const hsVector3 del(&newPos, &oldPos);
|
||||
hsScalar elapsed = hsTimer::GetDelSysSeconds();
|
||||
hsScalar speed = 0.f;
|
||||
float elapsed = hsTimer::GetDelSysSeconds();
|
||||
float speed = 0.f;
|
||||
if (elapsed > 0.f)
|
||||
speed = del.Magnitude() / elapsed;
|
||||
|
||||
if( speed > fSpeedClamp )
|
||||
{
|
||||
hsScalar parm = fSpeedClamp / speed;
|
||||
float parm = fSpeedClamp / speed;
|
||||
|
||||
hsMatrix44 clTgtXfm = IInterpMatrices(currL2W, unclTgtXfm, parm);
|
||||
|
||||
@ -616,12 +616,12 @@ void plLineFollowMod::RemoveTarget(plSceneObject* so)
|
||||
|
||||
void plLineFollowMod::AddStereizer(const plKey& key)
|
||||
{
|
||||
hsgResMgr::ResMgr()->SendRef(plKey(key), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefStereizer), plRefFlags::kPassiveRef);
|
||||
hsgResMgr::ResMgr()->SendRef(plKey(key), new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefStereizer), plRefFlags::kPassiveRef);
|
||||
}
|
||||
|
||||
void plLineFollowMod::RemoveStereizer(const plKey& key)
|
||||
{
|
||||
hsgResMgr::ResMgr()->SendRef(plKey(key), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRemove, 0, kRefStereizer), plRefFlags::kPassiveRef);
|
||||
hsgResMgr::ResMgr()->SendRef(plKey(key), new plGenRefMsg(GetKey(), plRefMsg::kOnRemove, 0, kRefStereizer), plRefFlags::kPassiveRef);
|
||||
}
|
||||
|
||||
// derived version of this class for rail cameras
|
||||
@ -658,9 +658,9 @@ hsBool plRailCameraMod::IGetTargetTransform(hsPoint3& searchPos, hsMatrix44& tg
|
||||
return true;
|
||||
}
|
||||
|
||||
hsPoint3 plRailCameraMod::GetGoal(double secs, hsScalar speed)
|
||||
hsPoint3 plRailCameraMod::GetGoal(double secs, float speed)
|
||||
{
|
||||
hsScalar delTime;
|
||||
float delTime;
|
||||
int dir;
|
||||
if (fTargetTime == fCurrentTime)
|
||||
return fGoal;
|
||||
@ -681,7 +681,7 @@ hsPoint3 plRailCameraMod::GetGoal(double secs, hsScalar speed)
|
||||
if (delTime <= (secs * speed))
|
||||
fCurrentTime = fTargetTime;
|
||||
else
|
||||
fCurrentTime += (hsScalar)((secs * speed) * dir);
|
||||
fCurrentTime += (float)((secs * speed) * dir);
|
||||
|
||||
if (fPath->GetWrap())
|
||||
{
|
||||
|
@ -81,7 +81,7 @@ public:
|
||||
};
|
||||
protected:
|
||||
FollowMode fFollowMode;
|
||||
UInt16 fFollowFlags;
|
||||
uint16_t fFollowFlags;
|
||||
|
||||
plAnimPath* fPath;
|
||||
plSceneObject* fPathParent;
|
||||
@ -92,12 +92,12 @@ protected:
|
||||
|
||||
hsTArray<plStereizer*> fStereizers;
|
||||
|
||||
hsScalar fTanOffset;
|
||||
hsScalar fOffset;
|
||||
hsScalar fOffsetClamp;
|
||||
hsScalar fSpeedClamp;
|
||||
float fTanOffset;
|
||||
float fOffset;
|
||||
float fOffsetClamp;
|
||||
float fSpeedClamp;
|
||||
|
||||
virtual hsBool IEval(double secs, hsScalar del, UInt32 dirty);
|
||||
virtual hsBool IEval(double secs, float del, uint32_t dirty);
|
||||
|
||||
virtual hsBool IGetSearchPos();
|
||||
virtual void ISetTargetTransform(int iTarg, const hsMatrix44& tgtXfm);
|
||||
@ -106,7 +106,7 @@ protected:
|
||||
virtual hsBool IGetTargetTransform(hsPoint3& searchPos, hsMatrix44& tgtXfm);
|
||||
virtual hsBool IOffsetTargetTransform(hsMatrix44& tgtXfm);
|
||||
virtual hsMatrix44 ISpeedClamp(plCoordinateInterface* ci, const hsMatrix44& unclTgtXfm);
|
||||
hsMatrix44 IInterpMatrices(const hsMatrix44& m0, const hsMatrix44& m1, hsScalar parm);
|
||||
hsMatrix44 IInterpMatrices(const hsMatrix44& m0, const hsMatrix44& m1, float parm);
|
||||
void ICheckForPop(const hsPoint3& oldPos, const hsPoint3& newPos);
|
||||
|
||||
void ISetupStereizers(const plListenerMsg* listMsg);
|
||||
@ -138,20 +138,20 @@ public:
|
||||
hsBool HasOffsetClamp() const { return 0 != (fFollowFlags & kOffsetClamp); }
|
||||
hsBool HasSpeedClamp() const { return 0 != (fFollowFlags & kSpeedClamp); }
|
||||
|
||||
void SetOffsetFeet(hsScalar f);
|
||||
hsScalar GetOffsetFeet() const { return fOffset; }
|
||||
void SetOffsetFeet(float f);
|
||||
float GetOffsetFeet() const { return fOffset; }
|
||||
|
||||
void SetOffsetDegrees(hsScalar f);
|
||||
hsScalar GetOffsetDegrees() const { return hsScalarRadToDeg(fOffset); }
|
||||
void SetOffsetDegrees(float f);
|
||||
float GetOffsetDegrees() const { return hsRadiansToDegrees(fOffset); }
|
||||
|
||||
void SetOffsetClamp(hsScalar f);
|
||||
hsScalar GetOffsetClamp() const { return fOffsetClamp; }
|
||||
void SetOffsetClamp(float f);
|
||||
float GetOffsetClamp() const { return fOffsetClamp; }
|
||||
|
||||
void SetForceToLine(hsBool on);
|
||||
hsBool GetForceToLine() const { return 0 != (fFollowFlags & kForceToLine); }
|
||||
|
||||
void SetSpeedClamp(hsScalar feetPerSec);
|
||||
hsScalar GetSpeedClamp() const { return fSpeedClamp; }
|
||||
void SetSpeedClamp(float feetPerSec);
|
||||
float GetSpeedClamp() const { return fSpeedClamp; }
|
||||
|
||||
hsBool MsgReceive(plMessage* msg);
|
||||
|
||||
@ -175,7 +175,7 @@ public:
|
||||
GETINTERFACE_ANY( plRailCameraMod, plLineFollowMod );
|
||||
|
||||
void Init() { fCurrentTime = -1; } // twiddle ourselves so we get ready to go...
|
||||
hsPoint3 GetGoal(double secs, hsScalar speed);
|
||||
hsPoint3 GetGoal(double secs, float speed);
|
||||
|
||||
protected:
|
||||
|
||||
@ -183,8 +183,8 @@ protected:
|
||||
virtual hsBool IGetTargetTransform(hsPoint3& searchPos, hsMatrix44& tgtXfm);
|
||||
|
||||
hsMatrix44 fDesiredMatrix;
|
||||
hsScalar fCurrentTime;
|
||||
hsScalar fTargetTime;
|
||||
float fCurrentTime;
|
||||
float fTargetTime;
|
||||
hsPoint3 fGoal;
|
||||
hsBool fFarthest;
|
||||
};
|
||||
|
@ -42,16 +42,16 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "hsTypes.h"
|
||||
#include "HeadSpin.h"
|
||||
#include "plRandomCommandMod.h"
|
||||
#include "pnSceneObject/plSceneObject.h"
|
||||
#include "plMessage/plAnimCmdMsg.h"
|
||||
#include "pnMessage/plEventCallbackMsg.h"
|
||||
#include "plgDispatch.h"
|
||||
#include "hsTimer.h"
|
||||
#include "hsUtils.h"
|
||||
|
||||
static const hsScalar kRandNormalize = 1.f / 32767.f;
|
||||
|
||||
static const float kRandNormalize = 1.f / 32767.f;
|
||||
|
||||
plRandomCommandMod::plRandomCommandMod()
|
||||
{
|
||||
@ -126,11 +126,11 @@ int plRandomCommandMod::IExcludeSelections(int ncmds)
|
||||
return ncmds;
|
||||
}
|
||||
|
||||
hsScalar plRandomCommandMod::IGetDelay(hsScalar len) const
|
||||
float plRandomCommandMod::IGetDelay(float len) const
|
||||
{
|
||||
hsScalar r = float(hsRand() * kRandNormalize);
|
||||
float r = float(hsRand() * kRandNormalize);
|
||||
|
||||
hsScalar delay = fMinDelay + (fMaxDelay - fMinDelay) * r;
|
||||
float delay = fMinDelay + (fMaxDelay - fMinDelay) * r;
|
||||
|
||||
if( fMode & kDelayFromEnd )
|
||||
delay += len;
|
||||
@ -156,7 +156,7 @@ hsBool plRandomCommandMod::ISelectNext(int ncmds)
|
||||
}
|
||||
return true;
|
||||
}
|
||||
hsScalar r = float(hsRand() * kRandNormalize);
|
||||
float r = float(hsRand() * kRandNormalize);
|
||||
|
||||
int nSelect = ncmds;
|
||||
|
||||
@ -294,13 +294,13 @@ void plRandomCommandMod::Write(hsStream* s, hsResMgr* mgr)
|
||||
s->WriteLEScalar(fMaxDelay);
|
||||
}
|
||||
|
||||
void plRandomCommandMod::IRetry(hsScalar secs)
|
||||
void plRandomCommandMod::IRetry(float secs)
|
||||
{
|
||||
IStop();
|
||||
|
||||
double t = hsTimer::GetSysSeconds() + secs;
|
||||
|
||||
plAnimCmdMsg* msg = TRACKED_NEW plAnimCmdMsg(nil, GetKey(), &t);
|
||||
plAnimCmdMsg* msg = new plAnimCmdMsg(nil, GetKey(), &t);
|
||||
msg->SetCmd(plAnimCmdMsg::kContinue);
|
||||
plgDispatch::MsgSend(msg);
|
||||
}
|
||||
|
@ -66,25 +66,25 @@ protected:
|
||||
|
||||
// These are only lightly synched, the only synched state is whether
|
||||
// they are currently active.
|
||||
UInt8 fState;
|
||||
uint8_t fState;
|
||||
|
||||
hsBitVector fExcluded;
|
||||
Int8 fCurrent;
|
||||
UInt8 fMode; // static, if it becomes dynamic, move to SynchedValue
|
||||
int8_t fCurrent;
|
||||
uint8_t fMode; // static, if it becomes dynamic, move to SynchedValue
|
||||
hsTArray<double> fEndTimes;
|
||||
|
||||
hsScalar fMinDelay;
|
||||
hsScalar fMaxDelay;
|
||||
float fMinDelay;
|
||||
float fMaxDelay;
|
||||
|
||||
void IStart();
|
||||
virtual void IStop();
|
||||
hsBool IStopped() const;
|
||||
void IRetry(hsScalar secs);
|
||||
void IRetry(float secs);
|
||||
virtual void IPlayNextIfMaster();
|
||||
|
||||
void IReset();
|
||||
|
||||
hsScalar IGetDelay(hsScalar len) const;
|
||||
float IGetDelay(float len) const;
|
||||
|
||||
int IExcludeSelections(int ncmds);
|
||||
hsBool ISelectNext(int nAnim); // return false if we should stop, else set fCurrent to next index
|
||||
@ -94,7 +94,7 @@ protected:
|
||||
virtual void IPlayNext() = 0;
|
||||
|
||||
// We only act in response to messages.
|
||||
virtual hsBool IEval(double secs, hsScalar del, UInt32 dirty) { return false; }
|
||||
virtual hsBool IEval(double secs, float del, uint32_t dirty) { return false; }
|
||||
|
||||
public:
|
||||
plRandomCommandMod();
|
||||
@ -109,17 +109,17 @@ public:
|
||||
virtual void Write(hsStream* s, hsResMgr* mgr);
|
||||
|
||||
// Export only
|
||||
void SetMode(UInt8 m) { fMode = m; }
|
||||
UInt8 GetMode() const { return fMode; }
|
||||
void SetMode(uint8_t m) { fMode = m; }
|
||||
uint8_t GetMode() const { return fMode; }
|
||||
|
||||
void SetState(UInt8 s) { fState = s; }
|
||||
UInt8 GetState() const { return fState; }
|
||||
void SetState(uint8_t s) { fState = s; }
|
||||
uint8_t GetState() const { return fState; }
|
||||
|
||||
void SetMinDelay(hsScalar f) { fMinDelay = f; }
|
||||
hsScalar GetMinDelay() const { return fMinDelay; }
|
||||
void SetMinDelay(float f) { fMinDelay = f; }
|
||||
float GetMinDelay() const { return fMinDelay; }
|
||||
|
||||
void SetMaxDelay(hsScalar f) { fMaxDelay = f; }
|
||||
hsScalar GetMaxDelay() const { return fMaxDelay; }
|
||||
void SetMaxDelay(float f) { fMaxDelay = f; }
|
||||
float GetMaxDelay() const { return fMaxDelay; }
|
||||
};
|
||||
|
||||
|
||||
|
@ -43,7 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "hsTypes.h"
|
||||
#include "HeadSpin.h"
|
||||
|
||||
#include "plStereizer.h"
|
||||
#include "plLineFollowMod.h"
|
||||
@ -119,7 +119,7 @@ hsBool plStereizer::MsgReceive(plMessage* msg)
|
||||
return plSingleModifier::MsgReceive(msg);
|
||||
}
|
||||
|
||||
hsBool plStereizer::IEval(double secs, hsScalar del, UInt32 dirty)
|
||||
hsBool plStereizer::IEval(double secs, float del, uint32_t dirty)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -135,7 +135,7 @@ hsBool plStereizer::Stereize()
|
||||
// Find distance to listener
|
||||
hsPoint3 pos = IGetUnStereoPos();
|
||||
hsVector3 posToList(&fListPos, &pos);
|
||||
hsScalar dist = posToList.Magnitude();
|
||||
float dist = posToList.Magnitude();
|
||||
|
||||
// If distance less than ambient distance
|
||||
// setup as pure ambient
|
||||
@ -210,14 +210,14 @@ hsPoint3 plStereizer::IGetAmbientPos() const
|
||||
return pos;
|
||||
}
|
||||
|
||||
hsPoint3 plStereizer::IGetLocalizedPos(const hsVector3& posToList, hsScalar distToList) const
|
||||
hsPoint3 plStereizer::IGetLocalizedPos(const hsVector3& posToList, float distToList) const
|
||||
{
|
||||
hsPoint3 pos = IGetUnStereoPos();
|
||||
|
||||
hsVector3 axOut(-posToList.fY, posToList.fX, 0);
|
||||
hsFastMath::NormalizeAppr(axOut);
|
||||
|
||||
hsScalar distOut = distToList * fTanAng;
|
||||
float distOut = distToList * fTanAng;
|
||||
if( distOut > fMaxSepDist )
|
||||
distOut = fMaxSepDist;
|
||||
else if( distOut < fMinSepDist )
|
||||
@ -232,12 +232,12 @@ hsPoint3 plStereizer::IGetLocalizedPos(const hsVector3& posToList, hsScalar dist
|
||||
return pos;
|
||||
}
|
||||
|
||||
void plStereizer::SetSepAngle(hsScalar rads)
|
||||
void plStereizer::SetSepAngle(float rads)
|
||||
{
|
||||
fTanAng = hsScalar(tan(rads));
|
||||
fTanAng = float(tan(rads));
|
||||
}
|
||||
|
||||
hsScalar plStereizer::GetSepAngle() const
|
||||
float plStereizer::GetSepAngle() const
|
||||
{
|
||||
return atan(fTanAng);
|
||||
}
|
||||
|
@ -67,13 +67,13 @@ protected:
|
||||
};
|
||||
|
||||
// Static properties
|
||||
hsScalar fAmbientDist;
|
||||
hsScalar fTransition;
|
||||
float fAmbientDist;
|
||||
float fTransition;
|
||||
|
||||
hsScalar fMaxSepDist;
|
||||
hsScalar fMinSepDist;
|
||||
float fMaxSepDist;
|
||||
float fMinSepDist;
|
||||
|
||||
hsScalar fTanAng;
|
||||
float fTanAng;
|
||||
|
||||
hsPoint3 fInitPos;
|
||||
|
||||
@ -82,9 +82,9 @@ protected:
|
||||
hsVector3 fListDirection;
|
||||
hsVector3 fListUp;
|
||||
|
||||
virtual hsBool IEval(double secs, hsScalar del, UInt32 dirty);
|
||||
virtual hsBool IEval(double secs, float del, uint32_t dirty);
|
||||
|
||||
hsPoint3 IGetLocalizedPos(const hsVector3& posToList, hsScalar distToList) const;
|
||||
hsPoint3 IGetLocalizedPos(const hsVector3& posToList, float distToList) const;
|
||||
hsPoint3 IGetAmbientPos() const;
|
||||
void ISetNewPos(const hsPoint3& newPos);
|
||||
|
||||
@ -109,20 +109,20 @@ public:
|
||||
hsBool Stereize();
|
||||
void SetFromListenerMsg(const plListenerMsg* listMsg);
|
||||
|
||||
void SetAmbientDist(hsScalar d) { fAmbientDist = d; }
|
||||
hsScalar GetAmbientDist() const { return fAmbientDist; }
|
||||
void SetAmbientDist(float d) { fAmbientDist = d; }
|
||||
float GetAmbientDist() const { return fAmbientDist; }
|
||||
|
||||
void SetTransition(hsScalar d) { fTransition = d; }
|
||||
hsScalar GetTransition() const { return fTransition; }
|
||||
void SetTransition(float d) { fTransition = d; }
|
||||
float GetTransition() const { return fTransition; }
|
||||
|
||||
void SetMaxSepDist(hsScalar d) { fMaxSepDist = d; }
|
||||
hsScalar GetMaxSepDist() const { return fMaxSepDist; }
|
||||
void SetMaxSepDist(float d) { fMaxSepDist = d; }
|
||||
float GetMaxSepDist() const { return fMaxSepDist; }
|
||||
|
||||
void SetMinSepDist(hsScalar d) { fMinSepDist = d; }
|
||||
hsScalar GetMinSepDist() const { return fMinSepDist; }
|
||||
void SetMinSepDist(float d) { fMinSepDist = d; }
|
||||
float GetMinSepDist() const { return fMinSepDist; }
|
||||
|
||||
void SetSepAngle(hsScalar rads);
|
||||
hsScalar GetSepAngle() const;
|
||||
void SetSepAngle(float rads);
|
||||
float GetSepAngle() const;
|
||||
|
||||
void SetAsLeftChannel(hsBool on) { if(on)SetFlag(kLeftChannel); else ClearFlag(kLeftChannel); }
|
||||
hsBool IsLeftChannel() const { return HasFlag(kLeftChannel); }
|
||||
|
@ -40,7 +40,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#include "hsTypes.h"
|
||||
#include "HeadSpin.h"
|
||||
#include "plViewFaceModifier.h"
|
||||
#include "plgDispatch.h"
|
||||
#include "pnSceneObject/plSceneObject.h"
|
||||
@ -86,7 +86,7 @@ void plViewFaceModifier::Read(hsStream* s, hsResMgr* mgr)
|
||||
fOrigParentToLocal.Read(s);
|
||||
|
||||
if( HasFlag(kFaceObj) )
|
||||
mgr->ReadKeyNotifyMe(s, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefFaceObj), plRefFlags::kPassiveRef);
|
||||
mgr->ReadKeyNotifyMe(s, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefFaceObj), plRefFlags::kPassiveRef);
|
||||
|
||||
fOffset.Read(s);
|
||||
|
||||
@ -129,7 +129,7 @@ void plViewFaceModifier::SetTarget(plSceneObject* so)
|
||||
plgDispatch::Dispatch()->RegisterForExactType(plArmatureUpdateMsg::Index(), GetKey());
|
||||
}
|
||||
|
||||
hsBool plViewFaceModifier::IEval(double secs, hsScalar del, UInt32 dirty)
|
||||
hsBool plViewFaceModifier::IEval(double secs, float del, uint32_t dirty)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -157,7 +157,7 @@ hsBool plViewFaceModifier::IFacePoint(plPipeline* pipe, const hsPoint3& at)
|
||||
}
|
||||
|
||||
hsPoint3 localAt = worldToLocal * at;
|
||||
hsScalar len = localAt.MagnitudeSquared();
|
||||
float len = localAt.MagnitudeSquared();
|
||||
if( len <= 0 )
|
||||
return false;
|
||||
len = -hsFastMath::InvSqrtAppr(len);
|
||||
@ -220,7 +220,7 @@ hsBool plViewFaceModifier::IFacePoint(plPipeline* pipe, const hsPoint3& at)
|
||||
x.fMap[3][0] = x.fMap[3][1] = x.fMap[3][2] = 0;
|
||||
xInv.fMap[0][3] = xInv.fMap[1][3] = xInv.fMap[2][3] = 0;
|
||||
|
||||
xInv.fMap[3][3] = x.fMap[3][3] = hsScalar1;
|
||||
xInv.fMap[3][3] = x.fMap[3][3] = 1.f;
|
||||
|
||||
x.NotIdentity();
|
||||
xInv.NotIdentity();
|
||||
@ -239,7 +239,7 @@ hsBool plViewFaceModifier::IFacePoint(plPipeline* pipe, const hsPoint3& at)
|
||||
x.fMap[2][1] *= fScale.fZ;
|
||||
x.fMap[2][2] *= fScale.fZ;
|
||||
|
||||
hsScalar inv = 1.f / fScale.fX;
|
||||
float inv = 1.f / fScale.fX;
|
||||
xInv.fMap[0][0] *= inv;
|
||||
xInv.fMap[1][0] *= inv;
|
||||
xInv.fMap[2][0] *= inv;
|
||||
@ -390,7 +390,7 @@ void plViewFaceModifier::IOnRemove(plGenRefMsg* refMsg)
|
||||
|
||||
void plViewFaceModifier::ISetObject(plKey soKey)
|
||||
{
|
||||
hsgResMgr::ResMgr()->SendRef(soKey, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefFaceObj), plRefFlags::kPassiveRef);
|
||||
hsgResMgr::ResMgr()->SendRef(soKey, new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefFaceObj), plRefFlags::kPassiveRef);
|
||||
}
|
||||
|
||||
void plViewFaceModifier::SetFollowMode(FollowMode m, plKey soKey)
|
||||
|
@ -84,7 +84,7 @@ protected:
|
||||
hsBounds3Ext fMaxBounds;
|
||||
|
||||
virtual hsBool IFacePoint(plPipeline* pipe, const hsPoint3& at);
|
||||
virtual hsBool IEval(double secs, hsScalar del, UInt32 dirty);
|
||||
virtual hsBool IEval(double secs, float del, uint32_t dirty);
|
||||
|
||||
enum RefType
|
||||
{
|
||||
|
Reference in New Issue
Block a user