1
0
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:
2012-01-28 17:20:01 -08:00
1722 changed files with 24149 additions and 27599 deletions

View File

@ -40,7 +40,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "hsTypes.h"
#include "HeadSpin.h"
#include "pfCameraProxy.h"
#include "plVirtualCamNeu.h"
#include "plDrawable/plDrawableGenerator.h"
@ -74,7 +74,7 @@ plKey plCameraProxy::IGetNode() const
return nil;
}
plDrawableSpans* plCameraProxy::ICreateProxy(hsGMaterial* mat, hsTArray<UInt32>& idx, plDrawableSpans* addTo)
plDrawableSpans* plCameraProxy::ICreateProxy(hsGMaterial* mat, hsTArray<uint32_t>& idx, plDrawableSpans* addTo)
{
if( fOwner )
{

View File

@ -54,7 +54,7 @@ protected:
plVirtualCam1* fOwner;
virtual plDrawableSpans* ICreateProxy(hsGMaterial* mat, hsTArray<UInt32>& idx, plDrawableSpans* addTo=nil);
virtual plDrawableSpans* ICreateProxy(hsGMaterial* mat, hsTArray<uint32_t>& idx, plDrawableSpans* addTo=nil);
virtual plKey IGetNode() const;
public:
plCameraProxy();

View File

@ -73,12 +73,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plNetClient/plNetClientMgr.h"
hsBool plCameraBrain1_FirstPerson::fDontFade = false;
hsScalar plCameraBrain1::fFallAccel = 20.0f;
hsScalar plCameraBrain1::fFallDecel = 5.0f;
hsScalar plCameraBrain1::fFallVelocity = 50.0f;
hsScalar plCameraBrain1::fFallPOAAccel = 10.0f;
hsScalar plCameraBrain1::fFallPOADecel = 10.0f;
hsScalar plCameraBrain1::fFallPOAVelocity = 50.0f;
float plCameraBrain1::fFallAccel = 20.0f;
float plCameraBrain1::fFallDecel = 5.0f;
float plCameraBrain1::fFallVelocity = 50.0f;
float plCameraBrain1::fFallPOAAccel = 10.0f;
float plCameraBrain1::fFallPOADecel = 10.0f;
float plCameraBrain1::fFallPOAVelocity = 50.0f;
// basic camera brain now is a fixed brain by default.
// if it doesn't have a subject (an object) it will just look straight ahead.
@ -176,13 +176,13 @@ void plCameraBrain1::Pop()
}
// set the goal to which we want to animate the fov
void plCameraBrain1::SetFOVGoal(hsScalar h, double t)
void plCameraBrain1::SetFOVGoal(float h, double t)
{
if (fFOVGoal == h || h == fCamera->GetFOVh())
return;
hsScalar dif = h - fCamera->GetFOVh();
fFOVAnimRate = dif / ((hsScalar)t);
float dif = h - fCamera->GetFOVh();
fFOVAnimRate = dif / ((float)t);
fFOVGoal = h;
fFOVStartTime = hsTimer::GetSysSeconds();
@ -192,7 +192,7 @@ void plCameraBrain1::SetFOVGoal(hsScalar h, double t)
}
// set parameters for how this camera zooms FOV based on user input (mostly for telescopes)
void plCameraBrain1::SetZoomParams(hsScalar max, hsScalar min, hsScalar rate)
void plCameraBrain1::SetZoomParams(float max, float min, float rate)
{
fZoomRate = rate;
fZoomMax = max;
@ -240,7 +240,7 @@ void plCameraBrain1::Update(hsBool forced)
// adjust FOV based on elapsed time
void plCameraBrain1::IAnimateFOV(double time)
{
hsScalar dH = fFOVAnimRate * hsTimer::GetDelSysSeconds();
float dH = fFOVAnimRate * hsTimer::GetDelSysSeconds();
dH += fCamera->GetFOVh();
@ -251,7 +251,7 @@ void plCameraBrain1::IAnimateFOV(double time)
dH = fFOVGoal;
}
fCamera->SetFOVw( (hsScalar)(dH * plVirtualCam1::Instance()->GetAspectRatio()) );
fCamera->SetFOVw( (float)(dH * plVirtualCam1::Instance()->GetAspectRatio()) );
fCamera->SetFOVh( dH );
}
@ -274,13 +274,13 @@ void plCameraBrain1::IMoveTowardGoal(double elapsedTime)
return;
}
hsVector3 dir(fGoal - fCamera->GetTargetPos());
hsScalar distToGoal=dir.Magnitude();
float distToGoal=dir.Magnitude();
//smooth out stoppage...
hsScalar adjMaxVel = fVelocity;
float adjMaxVel = fVelocity;
if (distToGoal <= 5.0f && distToGoal > 0.1f)
{
hsScalar mult = (distToGoal - 5.0f)*0.1f;
float mult = (distToGoal - 5.0f)*0.1f;
adjMaxVel = fVelocity - hsABS(fVelocity*mult);
}
@ -306,7 +306,7 @@ void plCameraBrain1::IMoveTowardGoal(double elapsedTime)
fCurCamSpeed = vel.Magnitude();
hsScalar distMoved;
float distMoved;
if (fFlags.IsBitSet(kPanicVelocity))
distMoved = IClampVelocity(&vel, 1000.0f, elapsedTime);
else
@ -350,16 +350,16 @@ void plCameraBrain1::IPointTowardGoal(double elapsedTime)
hsVector3 dir(fPOAGoal - fCamera->GetTargetPOA());
hsScalar distToGoal=dir.Magnitude();
float distToGoal=dir.Magnitude();
if (distToGoal > 0.0f)
dir.Normalize();
// smooth out stoppage
hsScalar adjMaxVel = fPOAVelocity;
float adjMaxVel = fPOAVelocity;
if (distToGoal <= 5.0f && distToGoal > 0.1f)
{
hsScalar mult = (distToGoal - 5.0f)*0.1f;
float mult = (distToGoal - 5.0f)*0.1f;
adjMaxVel = fPOAVelocity - hsABS(fPOAVelocity*mult);
}
@ -382,7 +382,7 @@ void plCameraBrain1::IPointTowardGoal(double elapsedTime)
fCurViewSpeed = vel.Magnitude();
hsScalar distMoved;
float distMoved;
if (fFlags.IsBitSet(kPanicVelocity))
distMoved = IClampVelocity(&vel, 1000.0f, elapsedTime);
else
@ -402,15 +402,15 @@ void plCameraBrain1::IPointTowardGoal(double elapsedTime)
}
void plCameraBrain1::IAdjustVelocity(hsScalar adjAccelRate, hsScalar adjDecelRate,
hsVector3* dir, hsVector3* vel, hsScalar maxSpeed,
hsScalar distToGoal, double elapsedTime)
void plCameraBrain1::IAdjustVelocity(float adjAccelRate, float adjDecelRate,
hsVector3* dir, hsVector3* vel, float maxSpeed,
float distToGoal, double elapsedTime)
{
hsScalar speed = vel->Magnitude(); // save current speed
float speed = vel->Magnitude(); // save current speed
*vel = *dir * speed; // change vel to correct dir
// compute accel/decel
hsScalar finalAccelRate;
float finalAccelRate;
if (IShouldDecelerate(adjDecelRate, speed, distToGoal))
{
@ -425,7 +425,7 @@ void plCameraBrain1::IAdjustVelocity(hsScalar adjAccelRate, hsScalar adjDecelRat
{
// compute accel vector in the direction of the goal
hsVector3 accelVec = *dir * finalAccelRate;
accelVec = accelVec * (hsScalar)elapsedTime;
accelVec = accelVec * (float)elapsedTime;
// add acceleration to velocity
*vel = *vel + accelVec;
@ -436,13 +436,13 @@ void plCameraBrain1::IAdjustVelocity(hsScalar adjAccelRate, hsScalar adjDecelRat
}
}
hsScalar plCameraBrain1::IClampVelocity(hsVector3* vel, hsScalar maxSpeed, double elapsedTime)
float plCameraBrain1::IClampVelocity(hsVector3* vel, float maxSpeed, double elapsedTime)
{
*vel = *vel * (hsScalar)elapsedTime;
maxSpeed *= (hsScalar)elapsedTime;
*vel = *vel * (float)elapsedTime;
maxSpeed *= (float)elapsedTime;
// clamp speed (clamp if going negative?)
hsScalar distMoved = vel->Magnitude();
float distMoved = vel->Magnitude();
if (distMoved > maxSpeed)
{
vel->Normalize();
@ -452,16 +452,16 @@ hsScalar plCameraBrain1::IClampVelocity(hsVector3* vel, hsScalar maxSpeed, doubl
return distMoved;
}
hsBool plCameraBrain1::IShouldDecelerate(hsScalar decelSpeed, hsScalar curSpeed, hsScalar distToGoal)
hsBool plCameraBrain1::IShouldDecelerate(float decelSpeed, float curSpeed, float distToGoal)
{
if (decelSpeed == 0)
// no deceleration
return false;
// compute distance required to stop, given decel speed (in units/sec sq)
hsScalar stopTime = curSpeed / decelSpeed;
hsScalar avgSpeed = curSpeed * .5f;
hsScalar stopDist = avgSpeed * stopTime;
float stopTime = curSpeed / decelSpeed;
float avgSpeed = curSpeed * .5f;
float stopDist = avgSpeed * stopTime;
return (hsABS(distToGoal) <= hsABS(stopDist)); // stopDist+avgSpeed?
}
@ -476,7 +476,7 @@ void plCameraBrain1::AdjustForInput(double secs)
if (fOffsetPct < 1.0f)
{
hsVector3 v(fPOAGoal - fGoal);
hsScalar len = v.Magnitude();
float len = v.Magnitude();
len = len - (len * fOffsetPct);
v.Normalize();
fGoal = fGoal + (v * len);
@ -487,10 +487,10 @@ void plCameraBrain1::Read(hsStream* stream, hsResMgr* mgr)
{
hsKeyedObject::Read(stream, mgr);
fPOAOffset.Read(stream);
plGenRefMsg* msg = TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kSubject ); // SceneObject
plGenRefMsg* msg = new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kSubject ); // SceneObject
mgr->ReadKeyNotifyMe( stream, msg, plRefFlags::kActiveRef );
plGenRefMsg* msg2 = TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnRequest, 0, kRailComponent ); // SceneObject
plGenRefMsg* msg2 = new plGenRefMsg( GetKey(), plRefMsg::kOnRequest, 0, kRailComponent ); // SceneObject
mgr->ReadKeyNotifyMe( stream, msg2, plRefFlags::kActiveRef );
fFlags.Read(stream);
@ -613,7 +613,7 @@ hsBool plCameraBrain1::MsgReceive(plMessage* msg)
}
else
{
plGenRefMsg* msg = TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kSubject ); // SceneObject
plGenRefMsg* msg = new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kSubject ); // SceneObject
hsgResMgr::ResMgr()->AddViaNotify(pPMsg->fPlayer, msg, plRefFlags::kPassiveRef);
fFlags.SetBit(kCutPosOnce);
@ -710,10 +710,10 @@ void plCameraBrain1::SetSubject(plSceneObject* sub)
//
hsScalar plCameraBrain1_Drive::fTurnRate = 100.0f;
hsScalar plCameraBrain1_Drive::fAcceleration = 200.0f;
hsScalar plCameraBrain1_Drive::fDeceleration = 200.0f;
hsScalar plCameraBrain1_Drive::fMaxVelocity = 100.0f;
float plCameraBrain1_Drive::fTurnRate = 100.0f;
float plCameraBrain1_Drive::fAcceleration = 200.0f;
float plCameraBrain1_Drive::fDeceleration = 200.0f;
float plCameraBrain1_Drive::fMaxVelocity = 100.0f;
// constructor
@ -764,7 +764,7 @@ void plCameraBrain1_Drive::Update(hsBool forced)
// update our desired position:
double time = hsTimer::GetSeconds();
hsScalar eTime = (hsScalar)(time-fLastTime);
float eTime = (float)(time-fLastTime);
if(eTime > 0.01f)
eTime = 0.01f;
fLastTime = time;
@ -772,7 +772,7 @@ void plCameraBrain1_Drive::Update(hsBool forced)
hsVector3 view, up, right;
fTargetMatrix.GetAxis(&view,&up,&right);
hsScalar delta = 5.0f * eTime;
float delta = 5.0f * eTime;
// adjust speed
if (HasMovementFlag(B_CAMERA_DRIVE_SPEED_UP))
@ -805,8 +805,8 @@ void plCameraBrain1_Drive::Update(hsBool forced)
fMaxVelocity = plVirtualCam1::Instance()->fVel;
}
hsScalar speed = fMaxVelocity;
hsScalar turn = 1.0f;
float speed = fMaxVelocity;
float turn = 1.0f;
if (HasMovementFlag(B_CONTROL_MODIFIER_FAST))
{
@ -973,7 +973,7 @@ plCameraBrain1_Avatar::~plCameraBrain1_Avatar()
if (fFaded)
{
plCameraTargetFadeMsg* pMsg = TRACKED_NEW plCameraTargetFadeMsg;
plCameraTargetFadeMsg* pMsg = new plCameraTargetFadeMsg;
pMsg->SetFadeOut(false);
pMsg->SetSubjectKey(plNetClientMgr::GetInstance()->GetLocalPlayerKey());
pMsg->SetBCastFlag(plMessage::kBCastByExactType);
@ -1102,7 +1102,7 @@ void plCameraBrain1_Avatar::CalculatePosition()
// check LOS
if (GetCamera()->GetKey() && fFlags.IsBitSet(kMaintainLOS) && (plVirtualCam1::Instance()->GetCurrentStackCamera() == GetCamera()))
{
plLOSRequestMsg* pMsg = TRACKED_NEW plLOSRequestMsg( GetCamera()->GetKey(), fPOAGoal, fGoal, plSimDefs::kLOSDBCameraBlockers,
plLOSRequestMsg* pMsg = new plLOSRequestMsg( GetCamera()->GetKey(), fPOAGoal, fGoal, plSimDefs::kLOSDBCameraBlockers,
plLOSRequestMsg::kTestClosest, plLOSRequestMsg::kReportHitOrMiss);
plgDispatch::MsgSend( pMsg );
}
@ -1148,7 +1148,7 @@ void plCameraBrain1_Avatar::ISendFadeMsg(hsBool fade)
else
plVirtualCam1::AddMsgToLog("current camera sending Fade In message to Avatar");
plCameraTargetFadeMsg* pMsg = TRACKED_NEW plCameraTargetFadeMsg;
plCameraTargetFadeMsg* pMsg = new plCameraTargetFadeMsg;
pMsg->SetFadeOut(fade);
pMsg->SetSubjectKey(GetSubject()->GetKey());
pMsg->SetBCastFlag(plMessage::kBCastByExactType);
@ -1397,7 +1397,7 @@ void plCameraBrain1_FirstPerson::CalculatePosition()
// check LOS
if (GetCamera()->GetKey() && fFlags.IsBitSet(kMaintainLOS) && (plVirtualCam1::Instance()->GetCurrentStackCamera() == GetCamera()))
{
plLOSRequestMsg* pMsg = TRACKED_NEW plLOSRequestMsg( GetCamera()->GetKey(), fPOAGoal, fGoal, plSimDefs::kLOSDBCameraBlockers,
plLOSRequestMsg* pMsg = new plLOSRequestMsg( GetCamera()->GetKey(), fPOAGoal, fGoal, plSimDefs::kLOSDBCameraBlockers,
plLOSRequestMsg::kTestClosest, plLOSRequestMsg::kReportHitOrMiss);
plgDispatch::MsgSend( pMsg );
}
@ -1436,7 +1436,7 @@ void plCameraBrain1_FirstPerson::Push(hsBool recenter)
if (plCameraBrain1_FirstPerson::fDontFade)
return;
plEnableMsg* pMsg = TRACKED_NEW plEnableMsg;
plEnableMsg* pMsg = new plEnableMsg;
pMsg->SetCmd(plEnableMsg::kDisable);
pMsg->AddType(plEnableMsg::kDrawable);
pMsg->SetBCastFlag(plMessage::kPropagateToModifiers);
@ -1481,7 +1481,7 @@ plCameraBrain1_Fixed::~plCameraBrain1_Fixed()
void plCameraBrain1_Fixed::Read(hsStream* stream, hsResMgr* mgr)
{
plCameraBrain1::Read(stream, mgr);
mgr->ReadKeyNotifyMe( stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, 99), plRefFlags::kPassiveRef);
mgr->ReadKeyNotifyMe( stream, new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, 99), plRefFlags::kPassiveRef);
}
void plCameraBrain1_Fixed::Write(hsStream* stream, hsResMgr* mgr)
@ -1583,7 +1583,7 @@ hsBool plCameraBrain1_Fixed::MsgReceive(plMessage* msg)
//
//
// circle camera crap
static const hsScalar kTwoPI = 2.0f*hsScalarPI;
static const float kTwoPI = 2.0f*M_PI;
plCameraBrain1_Circle::plCameraBrain1_Circle() : plCameraBrain1_Fixed()
{
@ -1656,17 +1656,17 @@ hsPoint3 plCameraBrain1_Circle::MoveTowardsFromGoal(const hsPoint3* fromGoal, do
if (fCurRad != fGoalRad)
{
hsScalar dist = hsABS(fGoalRad-fCurRad);
float dist = hsABS(fGoalRad-fCurRad);
hsAssert(dist>=0 && dist<=kTwoPI, "illegal radian diff");
hsBool mustWrap = (dist > hsScalarPI); // go opposite direction for shortcut and wrap
hsBool mustWrap = (dist > M_PI); // go opposite direction for shortcut and wrap
// compute speed
hsScalar speed;
float speed;
if (warp)
speed = (hsScalar)(kTwoPI * 100 * secs);
speed = (float)(kTwoPI * 100 * secs);
else
speed = (hsScalar)(kTwoPI * fCirPerSec * secs);
speed = (float)(kTwoPI * fCirPerSec * secs);
// move towards goalRad
hsAssert(fCurRad>=0 && fCurRad<=kTwoPI, "illegal radian value");
@ -1717,7 +1717,7 @@ hsPoint3 plCameraBrain1_Circle::MoveTowardsFromGoal(const hsPoint3* fromGoal, do
hsAssert(fCurRad>=0 && fCurRad<=kTwoPI, "illegal radian value");
hsPoint3 x;
x = GetCenterPoint() + hsVector3((hsScalar)hsCosine(fCurRad)*fRadius, (hsScalar)hsSine(fCurRad)*fRadius, 0.0f);
x = GetCenterPoint() + hsVector3((float)cos(fCurRad)*fRadius, (float)sin(fCurRad)*fRadius, 0.0f);
x.fZ = fCamera->GetTargetPos().fZ;
return x;
}
@ -1737,8 +1737,8 @@ hsPoint3 plCameraBrain1_Circle::IGetClosestPointOnCircle(const hsPoint3* toThis)
v = hsVector3(&center, &p);
}
v.Normalize();
fGoalRad = (hsScalar)atan2(v.fY, v.fX); // -pi to pi
hsAssert(fGoalRad>=-hsScalarPI && fGoalRad<=hsScalarPI, "Illegal atan2 val");
fGoalRad = (float)atan2(v.fY, v.fX); // -pi to pi
hsAssert(fGoalRad>=-M_PI && fGoalRad<=M_PI, "Illegal atan2 val");
if (fGoalRad<0)
fGoalRad = kTwoPI + fGoalRad; // 0 to 2pi
hsAssert(fGoalRad>=0 && fGoalRad<=kTwoPI, "Illegal atan2 val");
@ -1783,9 +1783,9 @@ void plCameraBrain1_Circle::Read(hsStream* stream, hsResMgr* mgr)
fCenter.Read(stream);
SetRadius(stream->ReadLEScalar());
plGenRefMsg* msg = TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kCircleTarget ); // SceneObject
plGenRefMsg* msg = new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kCircleTarget ); // SceneObject
mgr->ReadKeyNotifyMe( stream, msg, plRefFlags::kActiveRef );
plGenRefMsg* msg2 = TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnRequest, 0, kPOAObject ); // SceneObject
plGenRefMsg* msg2 = new plGenRefMsg( GetKey(), plRefMsg::kOnRequest, 0, kPOAObject ); // SceneObject
mgr->ReadKeyNotifyMe( stream, msg2, plRefFlags::kActiveRef );
fCirPerSec = stream->ReadLEScalar();
plgDispatch::Dispatch()->RegisterForExactType(plEvalMsg::Index(), GetKey());
@ -1842,7 +1842,7 @@ hsBool plCameraBrain1_Circle::MsgReceive(plMessage* msg)
}
if (fFlags.IsBitSet(kFollowLocalAvatar))
{
plGenRefMsg* msg = TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kSubject ); // SceneObject
plGenRefMsg* msg = new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kSubject ); // SceneObject
hsgResMgr::ResMgr()->AddViaNotify(pPMsg->fPlayer, msg, plRefFlags::kPassiveRef);
fFlags.SetBit(kCutPosOnce);

View File

@ -94,12 +94,12 @@ public:
void SetCamera(plCameraModifier1* pMod) { fCamera = pMod; }
void SetAccel (hsScalar f) { fAccel = f; }
void SetDecel (hsScalar f) { fDecel = f; }
void SetVelocity (hsScalar f) { fVelocity = f; }
void SetPOAAccel (hsScalar f) { fPOAAccel = f; }
void SetPOADecel (hsScalar f) { fPOADecel = f; }
void SetPOAVelocity (hsScalar f) { fPOAVelocity = f; }
void SetAccel (float f) { fAccel = f; }
void SetDecel (float f) { fDecel = f; }
void SetVelocity (float f) { fVelocity = f; }
void SetPOAAccel (float f) { fPOAAccel = f; }
void SetPOADecel (float f) { fPOADecel = f; }
void SetPOAVelocity (float f) { fPOAVelocity = f; }
const plCameraModifier1* GetCamera() { return fCamera; }
@ -128,13 +128,13 @@ public:
void SetGoal(hsPoint3 pt) { fGoal = pt; }
void SetPOAGoal(hsPoint3 pt) { fPOAGoal = pt; }
void SetFOVGoal(hsScalar h, double t);
void SetZoomParams(hsScalar max, hsScalar min, hsScalar rate);
void SetFOVGoal(float h, double t);
void SetZoomParams(float max, float min, float rate);
void SetXPanLimit(hsScalar x) {fXPanLimit = x;}
void SetZPanLimit(hsScalar y) {fZPanLimit = y;}
hsScalar GetXPanLimit() {return fXPanLimit;}
hsScalar GetZPanLimit() {return fZPanLimit;}
void SetXPanLimit(float x) {fXPanLimit = x;}
void SetZPanLimit(float y) {fZPanLimit = y;}
float GetXPanLimit() {return fXPanLimit;}
float GetZPanLimit() {return fZPanLimit;}
void SetRail(plRailCameraMod* m) { fRail = m; }
@ -144,28 +144,28 @@ public:
virtual void Push(hsBool recenter = true);
virtual void Pop();
hsScalar GetVelocity() { return fVelocity; }
hsScalar GetAccel() { return fAccel; }
hsScalar GetDecel() { return fDecel; }
hsScalar GetPOAAccel() { return fPOAAccel; }
hsScalar GetPOAVelocity() { return fPOAVelocity; }
hsScalar GetPOADecel() { return fPOADecel; }
float GetVelocity() { return fVelocity; }
float GetAccel() { return fAccel; }
float GetDecel() { return fDecel; }
float GetPOAAccel() { return fPOAAccel; }
float GetPOAVelocity() { return fPOAVelocity; }
float GetPOADecel() { return fPOADecel; }
hsScalar GetCurrentCamSpeed() { return fCurCamSpeed; }
hsScalar GetCurrentViewSpeed() { return fCurViewSpeed; }
float GetCurrentCamSpeed() { return fCurCamSpeed; }
float GetCurrentViewSpeed() { return fCurViewSpeed; }
void SetCurrentCamSpeed(hsScalar s) { fCurCamSpeed = s; }
void SetCurrentViewSpeed(hsScalar s) { fCurViewSpeed = s; }
void SetCurrentCamSpeed(float s) { fCurCamSpeed = s; }
void SetCurrentViewSpeed(float s) { fCurViewSpeed = s; }
hsMatrix44 GetTargetMatrix() { return fTargetMatrix; }
static hsScalar fFallVelocity;
static hsScalar fFallAccel;
static hsScalar fFallDecel;
static float fFallVelocity;
static float fFallAccel;
static float fFallDecel;
static hsScalar fFallPOAVelocity;
static hsScalar fFallPOAAccel;
static hsScalar fFallPOADecel;
static float fFallPOAVelocity;
static float fFallPOAAccel;
static float fFallPOADecel;
protected:
@ -173,48 +173,48 @@ protected:
void IMoveTowardGoal(double time);
void IPointTowardGoal(double time);
void IAnimateFOV(double time);
void IAdjustVelocity(hsScalar adjAccelRate,
hsScalar adjDecelRate,
void IAdjustVelocity(float adjAccelRate,
float adjDecelRate,
hsVector3* dir,
hsVector3* vel,
hsScalar maxSpeed,
hsScalar distToGoal,
float maxSpeed,
float distToGoal,
double elapsedTime);
hsScalar IClampVelocity(hsVector3* vel, hsScalar maxSpeed, double elapsedTime);
hsBool IShouldDecelerate(hsScalar decelSpeed, hsScalar curSpeed, hsScalar distToGoal);
float IClampVelocity(hsVector3* vel, float maxSpeed, double elapsedTime);
hsBool IShouldDecelerate(float decelSpeed, float curSpeed, float distToGoal);
plCameraModifier1* fCamera;
plKey fSubjectKey;
plRailCameraMod* fRail;
hsScalar fCurCamSpeed;
hsScalar fCurViewSpeed;
float fCurCamSpeed;
float fCurViewSpeed;
double fLastTime;
hsScalar fVelocity;
hsScalar fAccel;
hsScalar fDecel;
hsScalar fPOAVelocity;
hsScalar fPOAAccel;
hsScalar fPOADecel;
float fVelocity;
float fAccel;
float fDecel;
float fPOAVelocity;
float fPOAAccel;
float fPOADecel;
hsVector3 fPOAOffset;
hsPoint3 fGoal;
hsPoint3 fPOAGoal;
hsScalar fXPanLimit;
hsScalar fZPanLimit;
hsScalar fPanSpeed;
hsScalar fFOVGoal;
float fXPanLimit;
float fZPanLimit;
float fPanSpeed;
float fFOVGoal;
double fFOVStartTime;
double fFOVEndTime;
hsScalar fFOVAnimRate;
hsScalar fZoomRate;
hsScalar fZoomMax;
hsScalar fZoomMin;
float fFOVAnimRate;
float fZoomRate;
float fZoomMax;
float fZoomMin;
hsBitVector fMoveFlags;
hsBitVector fFlags;
hsMatrix44 fTargetMatrix;
hsScalar fOffsetLength;
hsScalar fOffsetPct;
float fOffsetLength;
float fOffsetPct;
double fFallTimer;
};
@ -226,8 +226,8 @@ protected:
hsPoint3 fDesiredPosition;
hsPoint3 fFacingTarget;
hsBool bUseDesiredFacing;
hsScalar deltaX;
hsScalar deltaY;
float deltaX;
float deltaY;
hsBool bDisregardY; // these are here to prevent
hsBool bDisregardX; // the camera from jumping when the mouse cursor recenters / wraps around.
hsVector3 fUp;
@ -238,7 +238,7 @@ public:
plCameraBrain1_Drive(plCameraModifier1* pMod);
~plCameraBrain1_Drive();
static void SetSensitivity(hsScalar f) { fTurnRate = f; }
static void SetSensitivity(float f) { fTurnRate = f; }
CLASSNAME_REGISTER( plCameraBrain1_Drive );
GETINTERFACE_ANY( plCameraBrain1_Drive, plCameraBrain1 );
@ -248,10 +248,10 @@ public:
virtual void Push(hsBool recenter = true);
virtual void Pop();
static hsScalar fAcceleration;
static hsScalar fDeceleration;
static hsScalar fMaxVelocity;
static hsScalar fTurnRate;
static float fAcceleration;
static float fDeceleration;
static float fMaxVelocity;
static float fTurnRate;
};
@ -362,13 +362,13 @@ public:
kCircleLocalAvatar = 0x40,
};
protected:
UInt32 fCircleFlags;
uint32_t fCircleFlags;
hsPoint3 fCenter;
plSceneObject* fCenterObject; // optional, use instead of fCenter
hsScalar fRadius;
hsScalar fCurRad, fGoalRad; // Radians
float fRadius;
float fCurRad, fGoalRad; // Radians
plSceneObject* fPOAObj; // in this case the subject is who we stay close to/away from
hsScalar fCirPerSec;
float fCirPerSec;
hsPoint3 IGetClosestPointOnCircle(const hsPoint3* toThisPt);
public:
@ -386,16 +386,16 @@ public:
virtual void Update(hsBool forced = false);
virtual hsBool MsgReceive(plMessage* msg);
UInt32 GetCircleFlags() { return fCircleFlags; }
uint32_t GetCircleFlags() { return fCircleFlags; }
hsPoint3* GetCenter() { return &fCenter; } // use GetCenterPoint
hsPoint3 GetCenterPoint();
hsScalar GetRadius() { return fRadius; }
float GetRadius() { return fRadius; }
plSceneObject* GetCenterObject() { return fCenterObject; }
void SetCircumferencePerSec(hsScalar h) { fCirPerSec = h; }
void SetCircleFlags(UInt32 f) { fCircleFlags|=f; }
void SetCircumferencePerSec(float h) { fCirPerSec = h; }
void SetCircleFlags(uint32_t f) { fCircleFlags|=f; }
void SetCenter(hsPoint3* ctr) { fCenter = *ctr; } // Circle lies in the plane z = ctr->z
void SetRadius(hsScalar radius) { fRadius = radius; }
void SetRadius(float radius) { fRadius = radius; }
void SetFarCircleCam(hsBool farType) { if (farType) fCircleFlags |= kFarthest; else fCircleFlags &= ~kFarthest; }
void SetCenterObjectKey(plKey k);
void SetPOAObject(plSceneObject* pObj) { fPOAObj = pObj; }

View File

@ -137,14 +137,14 @@ plSceneObject* plCameraModifier1::GetSubject()
return fSubObj;
}
void plCameraModifier1::SetFOVw(hsScalar f, hsBool fUpdateVCam)
void plCameraModifier1::SetFOVw(float f, hsBool fUpdateVCam)
{
fFOVw = f;
if (plVirtualCam1::Instance() && fUpdateVCam)
plVirtualCam1::SetFOV(fFOVw, fFOVh, this);
}
void plCameraModifier1::SetFOVh(hsScalar f, hsBool fUpdateVCam)
void plCameraModifier1::SetFOVh(float f, hsBool fUpdateVCam)
{
fFOVh = f;
if (plVirtualCam1::Instance() && fUpdateVCam)
@ -191,7 +191,7 @@ hsBool plCameraModifier1::MsgReceive(plMessage* msg)
double time = (double)fFOVInstructions[pEventMsg->fIndex]->GetConfig()->fAccel;
double time2 = (double)pEventMsg->fEventTime;
time = hsABS(time - time2);
hsScalar h = fFOVInstructions[pEventMsg->fIndex]->GetConfig()->fFOVh;
float h = fFOVInstructions[pEventMsg->fIndex]->GetConfig()->fFOVh;
if (GetBrain())
GetBrain()->SetFOVGoal(h, time);
}
@ -323,7 +323,7 @@ void plCameraModifier1::Read(hsStream* stream, hsResMgr* mgr)
{
hsKeyedObject::Read(stream, mgr);
fBrain = nil;
mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefBrain), plRefFlags::kActiveRef);
mgr->ReadKeyNotifyMe(stream, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefBrain), plRefFlags::kActiveRef);
int count = stream->ReadLE32();
int i;
for (i = 0; i < count; i++)
@ -333,14 +333,14 @@ void plCameraModifier1::Read(hsStream* stream, hsResMgr* mgr)
hsBool cutpos = stream->ReadBool();
hsBool cutpoa = stream->ReadBool();
hsBool ignore = stream->ReadBool();
hsScalar v = stream->ReadLEScalar();
hsScalar a = stream->ReadLEScalar();
hsScalar d = stream->ReadLEScalar();
hsScalar pV = stream->ReadLEScalar();
hsScalar pA = stream->ReadLEScalar();
hsScalar pD = stream->ReadLEScalar();
float v = stream->ReadLEScalar();
float a = stream->ReadLEScalar();
float d = stream->ReadLEScalar();
float pV = stream->ReadLEScalar();
float pA = stream->ReadLEScalar();
float pD = stream->ReadLEScalar();
CamTrans* camTrans = TRACKED_NEW CamTrans(key);
CamTrans* camTrans = new CamTrans(key);
camTrans->fAccel = a;
camTrans->fDecel = d;
camTrans->fVelocity = v;
@ -364,7 +364,7 @@ void plCameraModifier1::Read(hsStream* stream, hsResMgr* mgr)
}
for(i = 0; i < n; i++ )
{
mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, i, kRefCallbackMsg), plRefFlags::kActiveRef);
mgr->ReadKeyNotifyMe(stream, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, i, kRefCallbackMsg), plRefFlags::kActiveRef);
}
n = stream->ReadLE32();
@ -430,7 +430,7 @@ void plCameraModifier1::Push(hsBool recenter)
{
if (fStartAnimOnPush)
{
plAnimCmdMsg* pMsg = TRACKED_NEW plAnimCmdMsg;
plAnimCmdMsg* pMsg = new plAnimCmdMsg;
pMsg->SetCmd(plAnimCmdMsg::kRunForward);
pMsg->SetBCastFlag(plMessage::kPropagateToModifiers);
pMsg->AddReceiver(GetTarget()->GetKey());
@ -455,7 +455,7 @@ void plCameraModifier1::Pop()
{
if (fStopAnimOnPop)
{
plAnimCmdMsg* pMsg = TRACKED_NEW plAnimCmdMsg;
plAnimCmdMsg* pMsg = new plAnimCmdMsg;
pMsg->SetCmd(plAnimCmdMsg::kStop);
pMsg->SetBCastFlag(plMessage::kPropagateToModifiers);
pMsg->AddReceiver(GetTarget()->GetKey());
@ -465,7 +465,7 @@ void plCameraModifier1::Pop()
}
if (fResetAnimOnPop)
{
plAnimCmdMsg* pMsg = TRACKED_NEW plAnimCmdMsg;
plAnimCmdMsg* pMsg = new plAnimCmdMsg;
pMsg->SetCmd(plAnimCmdMsg::kGoToBegin);
pMsg->SetBCastFlag(plMessage::kPropagateToModifiers);
pMsg->AddReceiver(GetTarget()->GetKey());

View File

@ -75,12 +75,12 @@ struct CamTrans
hsBool fCutPos;
hsBool fCutPOA;
hsBool fIgnore;
hsScalar fAccel;
hsScalar fDecel;
hsScalar fVelocity;
hsScalar fPOAAccel;
hsScalar fPOADecel;
hsScalar fPOAVelocity;
float fAccel;
float fDecel;
float fVelocity;
float fPOAAccel;
float fPOADecel;
float fPOAVelocity;
};
@ -96,7 +96,7 @@ class plCameraModifier1 : public plSingleModifier
protected:
void Output();
virtual hsBool IEval(double secs, hsScalar del, UInt32 dirty) { return true; }
virtual hsBool IEval(double secs, float del, uint32_t dirty) { return true; }
public:
@ -128,10 +128,10 @@ public:
void SetTargetPOA(hsPoint3 pos) { fAt = pos; }
void SetSubworldPos(hsPoint3 pos) { fLastSubPos = pos; }
void SetSubworldPOA(hsPoint3 pos) { fLastSubPOA = pos; }
hsScalar GetFOVw() { return fFOVw; }
hsScalar GetFOVh() { return fFOVh; }
void SetFOVw(hsScalar f, hsBool fUpdateVCam = true);
void SetFOVh(hsScalar f, hsBool fUpdateVCam = true);
float GetFOVw() { return fFOVw; }
float GetFOVh() { return fFOVh; }
void SetFOVw(float f, hsBool fUpdateVCam = true);
void SetFOVh(float f, hsBool fUpdateVCam = true);
hsBool GetInSubworld() { return fInSubLastUpdate; }
void InSubworld(hsBool b) { fInSubLastUpdate = b; }
virtual void Read(hsStream* stream, hsResMgr* mgr);
@ -157,8 +157,8 @@ private:
plCameraBrain1* fBrain; // the 'logic' portion of the camera
hsTArray<CamTrans*> fTrans;
plSceneObject* fSubObj;
hsScalar fFOVw;
hsScalar fFOVh;
float fFOVw;
float fFOVh;
hsTArray<plMessage*> fMessageQueue;
hsTArray<plCameraMsg*> fFOVInstructions;
hsBool fAnimated, fStartAnimOnPush, fStopAnimOnPop, fResetAnimOnPop;

View File

@ -40,7 +40,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "hsTypes.h"
#include "HeadSpin.h"
#include "hsGeometry3.h"
#include "plgDispatch.h"
#include "pnSceneObject/plDrawInterface.h"
@ -52,11 +52,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pnKeyedObject/plKey.h"
hsScalar plInterestingModifier::fInterestRadius = 100.0f;
hsScalar plInterestingModifier::fInterestWeight = 1.0f;
float plInterestingModifier::fInterestRadius = 100.0f;
float plInterestingModifier::fInterestWeight = 1.0f;
hsBool plInterestingModifier::IEval(double secs, hsScalar del, UInt32 dirty)
hsBool plInterestingModifier::IEval(double secs, float del, uint32_t dirty)
{
for (int i=0; i < GetNumTargets(); i++)
{
@ -65,7 +65,7 @@ hsBool plInterestingModifier::IEval(double secs, hsScalar del, UInt32 dirty)
const hsBounds3Ext& targBnd = GetTarget(i)->GetDrawInterface()->GetWorldBounds();
if( targBnd.GetType() == kBoundsNormal )
{
plInterestingModMsg* pMsg = TRACKED_NEW plInterestingModMsg;
plInterestingModMsg* pMsg = new plInterestingModMsg;
pMsg->fPos= GetTarget(i)->GetDrawInterface()->GetWorldBounds().GetCenter();
pMsg->fSize = GetTarget(i)->GetDrawInterface()->GetWorldBounds().GetMaxDim();
pMsg->fRadius = fInterestRadius;

View File

@ -61,13 +61,13 @@ protected:
kTypeLookAtMod,
};
UInt8 fType;
hsScalar fView;
uint8_t fType;
float fView;
static hsScalar fInterestRadius;
static hsScalar fInterestWeight;
static float fInterestRadius;
static float fInterestWeight;
virtual hsBool IEval(double secs, hsScalar del, UInt32 dirty);
virtual hsBool IEval(double secs, float del, uint32_t dirty);
public:
plInterestingModifier(){ fType = kTypeInteresting;}
@ -78,16 +78,16 @@ public:
CLASSNAME_REGISTER( plInterestingModifier );
GETINTERFACE_ANY( plInterestingModifier, plSingleModifier );
hsScalar GetInterestWeight() { return fInterestWeight; }
hsScalar GetInterestRadius() { return fInterestRadius; }
float GetInterestWeight() { return fInterestWeight; }
float GetInterestRadius() { return fInterestRadius; }
void SetInterestWeight(hsScalar _InterestRadius) { fInterestWeight =_InterestRadius; }
void SetInterestRadius(hsScalar _InterestWeight) { fInterestRadius =_InterestWeight; }
void SetInterestWeight(float _InterestRadius) { fInterestWeight =_InterestRadius; }
void SetInterestRadius(float _InterestWeight) { fInterestRadius =_InterestWeight; }
virtual void AddTarget(plSceneObject* so);
void SetType(UInt8 type) { fType = type; }
UInt8 GetType() { return fType; }
void SetType(uint8_t type) { fType = type; }
uint8_t GetType() { return fType; }
};

View File

@ -40,6 +40,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "HeadSpin.h"
#include "plVirtualCamNeu.h"
#include "plCameraModifier.h"
#include "plCameraBrain.h"
@ -83,24 +84,23 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plAvatar/plAvatarMgr.h"
#include "hsGeometry3.h"
#include "hsConfig.h"
#include "hsQuat.h"
hsScalar plVirtualCam1::fFOVw = 45.0f;
hsScalar plVirtualCam1::fFOVh = 33.75f;
hsScalar plVirtualCam1::fHither = 0.3f;
hsScalar plVirtualCam1::fYon = 500.0f;
float plVirtualCam1::fFOVw = 45.0f;
float plVirtualCam1::fFOVh = 33.75f;
float plVirtualCam1::fHither = 0.3f;
float plVirtualCam1::fYon = 500.0f;
hsBool plVirtualCam1::printFOV = false;
hsBool plVirtualCam1::fUseAccelOverride = 1;
hsBool plVirtualCam1::freeze = 0;
//hsScalar plVirtualCam1::fAccel = 5.0f;
//hsScalar plVirtualCam1::fDecel = 5.0f;
//hsScalar plVirtualCam1::fVel = 10.0f;
hsScalar plVirtualCam1::fAccel = 50.0f;
hsScalar plVirtualCam1::fDecel = 50.0f;
hsScalar plVirtualCam1::fVel = 100.0f;
hsScalar plVirtualCam1::fPanResponseTime = 3.0f;
hsScalar plVirtualCam1::fFallTimerDelay = 0.25f;
//float plVirtualCam1::fAccel = 5.0f;
//float plVirtualCam1::fDecel = 5.0f;
//float plVirtualCam1::fVel = 10.0f;
float plVirtualCam1::fAccel = 50.0f;
float plVirtualCam1::fDecel = 50.0f;
float plVirtualCam1::fVel = 100.0f;
float plVirtualCam1::fPanResponseTime = 3.0f;
float plVirtualCam1::fFallTimerDelay = 0.25f;
hsBool plVirtualCam1::alwaysCutForColin = false;
hsBool plVirtualCam1::WalkPan3rdPerson = false;
hsBool plVirtualCam1::StayInFirstPersonForever = false;
@ -148,7 +148,7 @@ plVirtualCam1::plVirtualCam1()
fThirdPersonCam = nil;
fTransPos = POS_TRANS_OFF;
fPrevCam = nil;
fTransitionCamera = TRACKED_NEW plCameraModifier1;
fTransitionCamera = new plCameraModifier1;
fTransitionCamera->RegisterAs(kTransitionCamera_KEY);
// set initial view position
fOutputPos.Set(100,100,100);
@ -164,8 +164,8 @@ plVirtualCam1::plVirtualCam1()
fCameraDriveInterface = plDebugInputInterface::GetInstance();
hsRefCnt_SafeRef( fCameraDriveInterface );
fDriveCamera = TRACKED_NEW plCameraModifier1;
plCameraBrain1* pDriveBrain = TRACKED_NEW plCameraBrain1_Drive(fDriveCamera);
fDriveCamera = new plCameraModifier1;
plCameraBrain1* pDriveBrain = new plCameraBrain1_Drive(fDriveCamera);
PushCamera(fDriveCamera);
fForceCutOnce=false;
@ -186,7 +186,7 @@ plVirtualCam1::plVirtualCam1()
// only open log file if logging is on
if ( !plStatusLog::fLoggingOff )
{
wchar fileAndPath[MAX_PATH];
wchar_t fileAndPath[MAX_PATH];
PathGetLogDirectory(fileAndPath, arrsize(fileAndPath));
PathAddFilename(fileAndPath, fileAndPath, L"camLog.txt", arrsize(fileAndPath));
foutLog = _wfopen( fileAndPath, L"wt" );
@ -262,7 +262,7 @@ void plVirtualCam1::RebuildStack(const plKey& key)
}
if (!HasFlags(kFirstPersonAtLinkOut))
{
plEnableMsg* pMsg = TRACKED_NEW plEnableMsg;
plEnableMsg* pMsg = new plEnableMsg;
pMsg->SetSender(GetKey());
pMsg->SetCmd(plEnableMsg::kEnable);
pMsg->AddType(plEnableMsg::kDrawable);
@ -287,7 +287,7 @@ void plVirtualCam1::SetOffset(float x, float y, float z)
}
// static function
void plVirtualCam1::SetFOV(hsScalar x, hsScalar y)
void plVirtualCam1::SetFOV(float x, float y)
{
float fovW = y * fAspectRatio;
@ -307,12 +307,12 @@ if (printFOV)
}
// static function
void plVirtualCam1::SetFOV(hsScalar x, hsScalar y, plCameraModifier1* pCam)
void plVirtualCam1::SetFOV(float x, float y, plCameraModifier1* pCam)
{
if (plVirtualCam1::Instance()->GetCurrentCamera() != pCam)
return;
hsScalar diff = hsABS(fFOVw - x);
float diff = hsABS(fFOVw - x);
if (diff > 10.0f)
{
#ifdef STATUS_LOG
@ -339,7 +339,7 @@ void plVirtualCam1::SetFOV(hsScalar x, hsScalar y, plCameraModifier1* pCam)
// static function
void plVirtualCam1::SetDepth(hsScalar h, hsScalar y)
void plVirtualCam1::SetDepth(float h, float y)
{
return;
fHither = h;
@ -490,7 +490,7 @@ void plVirtualCam1::ICreatePlate()
plMipmap *ourMip = fEffectPlate->CreateMaterial( 16, 16, true );
for( y = 0; y < ourMip->GetHeight(); y++ )
{
UInt32 *pixels = ourMip->GetAddr32( 0, y );
uint32_t *pixels = ourMip->GetAddr32( 0, y );
for( x = 0; x < ourMip->GetWidth(); x++ )
pixels[ x ] = 0xff000000;
}
@ -684,17 +684,17 @@ void plVirtualCam1::AdjustForInput()
UnPanIfNeeded();
hsScalar panSpeed = 0.5f;
float panSpeed = 0.5f;
double secs = hsTimer::GetDelSysSeconds();
if (HasMovementFlag(B_CAMERA_PAN_UP))
fY -= (hsScalar)(panSpeed * secs);
fY -= (float)(panSpeed * secs);
if (HasMovementFlag(B_CAMERA_PAN_DOWN))
fY += (hsScalar)(panSpeed * secs);
fY += (float)(panSpeed * secs);
if (HasMovementFlag(B_CAMERA_PAN_LEFT))
fX -= (hsScalar)(panSpeed * secs);
fX -= (float)(panSpeed * secs);
if (HasMovementFlag(B_CAMERA_PAN_RIGHT))
fX += (hsScalar)(panSpeed * secs);
fX += (float)(panSpeed * secs);
}
if ((fY == 0.5f && fX == 0.5f) &&
fFirstPersonOverride == nil)
@ -725,17 +725,17 @@ void plVirtualCam1::AdjustForInput()
// scale maximum angle by % mouse input
hsScalar scaledX;
float scaledX;
if (fFirstPersonOverride)
scaledX = 3.14159;
else
scaledX = (hsScalar)(3.14159 - (fXPanLimit * ( (fX - 0.5f) / 0.5f)));
scaledX = (float)(3.14159 - (fXPanLimit * ( (fX - 0.5f) / 0.5f)));
hsScalar scaledZ;
float scaledZ;
if (fFirstPersonOverride)
scaledZ = (hsScalar)(3.14159 - (0.872f * ( (fY - 0.5f) / 0.5f)));
scaledZ = (float)(3.14159 - (0.872f * ( (fY - 0.5f) / 0.5f)));
else
scaledZ = (hsScalar)(3.14159 - (fZPanLimit * ( (fY - 0.5f) / 0.5f)));
scaledZ = (float)(3.14159 - (fZPanLimit * ( (fY - 0.5f) / 0.5f)));
hsMatrix44 mX;
hsMatrix44 mZ;
@ -824,7 +824,7 @@ void plVirtualCam1::Output()
fFadeCounter-=1;
if (fFadeCounter == 0 && fFirstPersonOverride == nil)
{
plEnableMsg* pMsg = TRACKED_NEW plEnableMsg;
plEnableMsg* pMsg = new plEnableMsg;
pMsg->SetSender(GetKey());
pMsg->SetCmd(plEnableMsg::kEnable);
pMsg->AddType(plEnableMsg::kDrawable);
@ -888,7 +888,7 @@ void plVirtualCam1::Init()
plgDispatch::Dispatch()->RegisterForExactType(plPlayerPageMsg::Index(), GetKey());
// register for control messages
plCmdIfaceModMsg* pModMsg = TRACKED_NEW plCmdIfaceModMsg;
plCmdIfaceModMsg* pModMsg = new plCmdIfaceModMsg;
pModMsg->SetBCastFlag(plMessage::kBCastByExactType);
pModMsg->SetSender(GetKey());
pModMsg->SetCmd(plCmdIfaceModMsg::kAdd);
@ -1068,8 +1068,8 @@ hsBool plVirtualCam1::MsgReceive(plMessage* msg)
{
if (!HasFlags(kFalling))
{
hsScalar dX = pMouseMsg->GetDX();
hsScalar dY = pMouseMsg->GetDY();
float dX = pMouseMsg->GetDX();
float dY = pMouseMsg->GetDY();
if (plMouseDevice::GetInverted())
{
dX *= -1.f;
@ -1238,7 +1238,7 @@ hsBool plVirtualCam1::MsgReceive(plMessage* msg)
fPythonOverride->Push(!HasFlags(kAvatarWalking));
CamTrans* pTrans = TRACKED_NEW CamTrans(fPythonOverride->GetKey());
CamTrans* pTrans = new CamTrans(fPythonOverride->GetKey());
if (pCam->Cmd(plCameraMsg::kPythonOverridePushCut))
pTrans->fCutPOA = pTrans->fCutPos = true;
StartTransition(pTrans);
@ -1302,7 +1302,7 @@ hsBool plVirtualCam1::MsgReceive(plMessage* msg)
if (HasFlags(kJustLinkedIn))
{
ClearFlags(kJustLinkedIn);
plCameraTargetFadeMsg* pMsg = TRACKED_NEW plCameraTargetFadeMsg;
plCameraTargetFadeMsg* pMsg = new plCameraTargetFadeMsg;
pMsg->SetFadeOut(true);
pMsg->SetSubjectKey(plNetClientMgr::GetInstance()->GetLocalPlayerKey());
pMsg->SetBCastFlag(plMessage::kBCastByExactType);
@ -1420,17 +1420,17 @@ void plVirtualCam1::CreateDefaultCamera(plSceneObject* subject)
if (mod->GetSubject() == subject)
return;
plGenRefMsg* msg = TRACKED_NEW plGenRefMsg(mod->GetKey(), plRefMsg::kOnReplace, 0, plCameraBrain1::kSubject );
plGenRefMsg* msg = new plGenRefMsg(mod->GetKey(), plRefMsg::kOnReplace, 0, plCameraBrain1::kSubject );
msg->SetOldRef(mod->GetSubject());
hsgResMgr::ResMgr()->AddViaNotify(subject->GetKey(), msg, plRefFlags::kPassiveRef);
}
else
{
plCameraModifier1* pMod = TRACKED_NEW plCameraModifier1;
plCameraBrain1_FirstPerson* pBrain = TRACKED_NEW plCameraBrain1_FirstPerson(pMod);
plCameraModifier1* pMod = new plCameraModifier1;
plCameraBrain1_FirstPerson* pBrain = new plCameraBrain1_FirstPerson(pMod);
pMod->RegisterAs( kDefaultCameraMod1_KEY );
//pBrain->SetSubject(subject);
plGenRefMsg* msg = TRACKED_NEW plGenRefMsg(pMod->GetKey(), plRefMsg::kOnCreate, 0, plCameraBrain1::kSubject ); // SceneObject
plGenRefMsg* msg = new plGenRefMsg(pMod->GetKey(), plRefMsg::kOnCreate, 0, plCameraBrain1::kSubject ); // SceneObject
hsgResMgr::ResMgr()->AddViaNotify(subject->GetKey(), msg, plRefFlags::kPassiveRef);
plgDispatch::Dispatch()->RegisterForExactType(plEvalMsg::Index(), pMod->GetKey());
@ -1459,16 +1459,16 @@ void plVirtualCam1::CreateDefaultCamera(plSceneObject* subject)
if (mod->GetSubject() == subject)
return;
plGenRefMsg* msg = TRACKED_NEW plGenRefMsg(mod->GetKey(), plRefMsg::kOnReplace, 0, plCameraBrain1::kSubject );
plGenRefMsg* msg = new plGenRefMsg(mod->GetKey(), plRefMsg::kOnReplace, 0, plCameraBrain1::kSubject );
msg->SetOldRef(mod->GetSubject());
hsgResMgr::ResMgr()->AddViaNotify(subject->GetKey(), msg, plRefFlags::kPassiveRef);
}
else
{
plCameraModifier1* pModx = TRACKED_NEW plCameraModifier1;
plCameraBrain1_Avatar* pBrainx = TRACKED_NEW plCameraBrain1_Avatar(pModx);
plCameraModifier1* pModx = new plCameraModifier1;
plCameraBrain1_Avatar* pBrainx = new plCameraBrain1_Avatar(pModx);
pModx->RegisterAs( kBuiltIn3rdPersonCamera_KEY );
plGenRefMsg* msgx = TRACKED_NEW plGenRefMsg(pModx->GetKey(), plRefMsg::kOnCreate, 0, plCameraBrain1::kSubject ); // SceneObject
plGenRefMsg* msgx = new plGenRefMsg(pModx->GetKey(), plRefMsg::kOnCreate, 0, plCameraBrain1::kSubject ); // SceneObject
hsgResMgr::ResMgr()->AddViaNotify(subject->GetKey(), msgx, plRefFlags::kPassiveRef);
plgDispatch::Dispatch()->RegisterForExactType(plEvalMsg::Index(), pModx->GetKey());
@ -1503,7 +1503,7 @@ void plVirtualCam1::AddCameraToStack(plCameraModifier1* pCam)
}
if (pCam->GetKey())
hsgResMgr::ResMgr()->AddViaNotify(pCam->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefCamera), plRefFlags::kPassiveRef);
hsgResMgr::ResMgr()->AddViaNotify(pCam->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefCamera), plRefFlags::kPassiveRef);
}
void plVirtualCam1::PushCamera(plCameraModifier1* pCam, hsBool bDefault)
@ -1570,7 +1570,7 @@ void plVirtualCam1::PushCamera(plCameraModifier1* pCam, hsBool bDefault)
if (!pCam->SetFaded(true))
{
// new camera doesn't support fading, fade him back in
plCameraTargetFadeMsg* pMsg = TRACKED_NEW plCameraTargetFadeMsg;
plCameraTargetFadeMsg* pMsg = new plCameraTargetFadeMsg;
pMsg->SetFadeOut(false);
pMsg->SetSubjectKey(GetCurrentStackCamera()->GetBrain()->GetSubject()->GetKey());
pMsg->SetBCastFlag(plMessage::kBCastByExactType);
@ -1628,7 +1628,7 @@ void plVirtualCam1::PushCamera(plCameraModifier1* pCam, hsBool bDefault)
// do a track transition here;
fPrevCam = GetCurrentStackCamera();
AddCameraToStack(pCam);
pTrans = TRACKED_NEW CamTrans(pCam->GetKey());
pTrans = new CamTrans(pCam->GetKey());
StartTransition(pTrans);
delete(pTrans);
#ifdef STATUS_LOG
@ -1639,7 +1639,7 @@ void plVirtualCam1::PushCamera(plCameraModifier1* pCam, hsBool bDefault)
{
// both fixed brains, cut between them
AddCameraToStack(pCam);
pTrans = TRACKED_NEW CamTrans(pCam->GetKey());
pTrans = new CamTrans(pCam->GetKey());
pTrans->fCutPOA = true;
pTrans->fCutPos = true;
StartTransition(pTrans);
@ -1747,7 +1747,7 @@ void plVirtualCam1::PopCamera(plCameraModifier1* pCam)
if (!GetCurrentStackCamera()->SetFaded(true))
{
// new camera doesn't support fading, fade him back in
plCameraTargetFadeMsg* pMsg = TRACKED_NEW plCameraTargetFadeMsg;
plCameraTargetFadeMsg* pMsg = new plCameraTargetFadeMsg;
pMsg->SetFadeOut(false);
pMsg->SetSubjectKey(pCam->GetBrain()->GetSubject()->GetKey());
pMsg->SetBCastFlag(plMessage::kBCastByExactType);
@ -1781,14 +1781,14 @@ void plVirtualCam1::PopCamera(plCameraModifier1* pCam)
{
// do a track transition here;
fPrevCam = pCam;
pTrans = TRACKED_NEW CamTrans(GetCurrentStackCamera()->GetKey());
pTrans = new CamTrans(GetCurrentStackCamera()->GetKey());
StartTransition(pTrans);
delete(pTrans);
}
else
{
fPrevCam = pCam;
pTrans = TRACKED_NEW CamTrans(GetCurrentStackCamera()->GetKey());
pTrans = new CamTrans(GetCurrentStackCamera()->GetKey());
pTrans->fCutPOA = true;
pTrans->fCutPos = true;
StartTransition(pTrans);
@ -1867,7 +1867,7 @@ void plVirtualCam1::StartTransition(CamTrans* transition)
if ( (fPythonOverride && plCameraBrain1_Avatar::ConvertNoRef(fPythonOverride->GetBrain())) ||
(plCameraBrain1_Avatar::ConvertNoRef(pCam->GetBrain()) && !fPythonOverride) )
{
plCameraBrain1_Avatar* pAvBrain = TRACKED_NEW plCameraBrain1_Avatar;
plCameraBrain1_Avatar* pAvBrain = new plCameraBrain1_Avatar;
pAvBrain->SetOffset(((plCameraBrain1_Avatar*)pCam->GetBrain())->GetOffset());
pAvBrain->SetPOAOffset(pCam->GetBrain()->GetPOAOffset());
@ -1888,7 +1888,7 @@ void plVirtualCam1::StartTransition(CamTrans* transition)
}
else
{
pBrain = TRACKED_NEW plCameraBrain1;
pBrain = new plCameraBrain1;
}
pBrain->SetFlags(plCameraBrain1::kIsTransitionCamera);
@ -1906,7 +1906,7 @@ void plVirtualCam1::StartTransition(CamTrans* transition)
curVec.fZ = transVec.fZ = 0;
transVec.Normalize();
curVec.Normalize();
hsScalar dot = curVec * transVec;
float dot = curVec * transVec;
if (dot <= 0.5f || transVec.MagnitudeSquared() != 0.0f)
{
pBrain->SetPOAAccel(100);
@ -1973,7 +1973,7 @@ void plVirtualCam1::StartTransition(CamTrans* transition)
pBrain->SetCamera(fTransitionCamera);
// deal with FOV -
hsScalar diffH = hsABS(pCam->GetFOVh() - fPrevCam->GetFOVh());
float diffH = hsABS(pCam->GetFOVh() - fPrevCam->GetFOVh());
if ( diffH )
{
double time = 0;
@ -2029,7 +2029,7 @@ void plVirtualCam1::RunTransition()
plCameraBrain1_Avatar* pAvBr = plCameraBrain1_Avatar::ConvertNoRef(pBrain);
if (pAvBr)
{
hsScalar off = pAvBr->GetOffset().MagnitudeSquared();
float off = pAvBr->GetOffset().MagnitudeSquared();
hsVector3 dist(pToCam->GetTargetPos() - fTransitionCamera->GetTargetPos());
if (dist.MagnitudeSquared() > off)
fTransitionCamera->GetBrain()->SetFlags(plCameraBrain1::kPanicVelocity);

View File

@ -120,13 +120,13 @@ public:
void Init();
virtual hsBool MsgReceive(plMessage* msg);
static void SetFOV(hsScalar w, hsScalar h);
static void SetFOV(hsScalar w, hsScalar h, plCameraModifier1* pCam);
static void SetDepth(hsScalar h, hsScalar y);
static hsScalar GetFOVw() { return fFOVw; }
static hsScalar GetFOVh() { return fFOVh; }
static hsScalar GetHither() { return fHither; }
static hsScalar GetYon() { return fYon; }
static void SetFOV(float w, float h);
static void SetFOV(float w, float h, plCameraModifier1* pCam);
static void SetDepth(float h, float y);
static float GetFOVw() { return fFOVw; }
static float GetFOVh() { return fFOVh; }
static float GetHither() { return fHither; }
static float GetYon() { return fYon; }
static void SetOffset(float x, float y, float z);
static void SetAspectRatio(float aspect) { fAspectRatio = aspect; }
static float GetAspectRatio() { return fAspectRatio; }
@ -174,8 +174,8 @@ public:
void StartUnPan();
// these are for console access
static hsBool fUseAccelOverride, freeze, alwaysCutForColin, WalkPan3rdPerson,StayInFirstPersonForever;
static hsScalar fDecel, fAccel, fVel;
static hsScalar fFallTimerDelay;
static float fDecel, fAccel, fVel;
static float fFallTimerDelay;
private:
@ -215,19 +215,19 @@ private:
hsBitVector fFlags;
hsTArray<plSceneObject*> fCamerasLoaded;
hsBitVector fMoveFlags;
hsScalar fX;
hsScalar fY;
hsScalar fXPanLimit;
hsScalar fZPanLimit;
hsScalar fXPanLimitGoal;
hsScalar fZPanLimitGoal;
hsScalar fXUnPanRate;
hsScalar fZUnPanRate;
hsScalar fXPanInterpRate;
hsScalar fZPanInterpRate;
float fX;
float fY;
float fXPanLimit;
float fZPanLimit;
float fXPanLimitGoal;
float fZPanLimitGoal;
float fXUnPanRate;
float fZUnPanRate;
float fXPanInterpRate;
float fZPanInterpRate;
double fUnPanEndTime;
double fInterpPanLimitTime;
hsScalar fRetainedFY;
float fRetainedFY;
// built-in cameras
plCameraModifier1* fDriveCamera; // for driving around
@ -237,11 +237,11 @@ private:
plCameraModifier1* fPrevCam; // the last camera we were displaying
plCameraModifier1* fThirdPersonCam; // built in third person cam for ccr's when they jump about
static hsScalar fFOVh, fFOVw;
static hsScalar fHither, fYon;
static float fFOVh, fFOVw;
static float fHither, fYon;
static plVirtualCam1* fInstance;
static hsBool printFOV;
static hsScalar fPanResponseTime;
static float fPanResponseTime;
static float fAspectRatio;
hsBool fForceCutOnce;