Browse Source

Hoikas support for widescreen field of view (Hor+)

1e7cbc3daf
2a7d97d520
a8b667ca1e
Includes selected changes from "Obliterate hsBool":
a709e17069
tickets/04/4/1
John Johns 4 years ago
parent
commit
9a3f202d66
  1. 3
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClient/plClient.cpp
  2. 80
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.cpp
  3. 7
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.h
  4. 15
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfCamera/plCameraModifier.cpp
  5. 1
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfCamera/plCameraModifier.h
  6. 96
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfCamera/plVirtualCamNeu.cpp
  7. 7
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfCamera/plVirtualCamNeu.h
  8. 19
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfPython/cyCamera.cpp
  9. 5
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfPython/cyCamera.h
  10. 1
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/NucleusLib/pnMessage/plCameraMsg.h
  11. 6
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp

3
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClient/plClient.cpp

@ -1545,8 +1545,7 @@ hsBool plClient::StartInit()
fNewCamera->SetPipeline( GetPipeline() );
float aspectratio = (float)fPipeline->Width() / (float)fPipeline->Height();
plVirtualCam1::SetAspectRatio(aspectratio);
plVirtualCam1::SetFOV(plVirtualCam1::GetFOVw(), plVirtualCam1::GetFOVh());
plVirtualCam1::Refresh();
pfGameGUIMgr::GetInstance()->SetAspectRatio( aspectratio );
plMouseDevice::Instance()->SetDisplayResolution((float)fPipeline->Width(), (float)fPipeline->Height());

80
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.cpp

@ -175,18 +175,32 @@ void plCameraBrain1::Pop()
}
// set the goal to which we want to animate the fov
void plCameraBrain1::SetFOVGoal(hsScalar h, double t)
void plCameraBrain1::SetFOVGoal(hsScalar w, hsScalar h, double t)
{
if (fFOVGoal == h || h == fCamera->GetFOVh())
if (fFOVhGoal == h || h == fCamera->GetFOVh() &&
fFOVwGoal == w || w == fCamera->GetFOVw())
return;
hsScalar dif = h - fCamera->GetFOVh();
fFOVAnimRate = dif / ((hsScalar)t);
fFOVhAnimRate = dif / ((hsScalar)t);
fFOVGoal = h;
fFOVhGoal = h;
fFOVStartTime = hsTimer::GetSysSeconds();
fFOVEndTime = fFOVStartTime + t;
if (w == 0.f)
{
fFOVwGoal = IMakeFOVwZoom(h);
dif = fFOVwGoal - fCamera->GetFOVw();
fFOVwAnimRate = dif / ((float)t);
}
else
{
dif = w - fCamera->GetFOVw();
fFOVwAnimRate = dif / ((float)t);
fFOVwGoal = w;
}
fFlags.SetBit(kAnimateFOV);
}
@ -239,19 +253,26 @@ void plCameraBrain1::Update(hsBool forced)
// adjust FOV based on elapsed time
void plCameraBrain1::IAnimateFOV(double time)
{
hsScalar dH = fFOVAnimRate * hsTimer::GetDelSysSeconds();
hsScalar dH = fFOVhAnimRate * hsTimer::GetDelSysSeconds();
hsScalar dW = fFOVwAnimRate * hsTimer::GetDelSysSeconds();
dH += fCamera->GetFOVh();
dW += fCamera->GetFOVw();
if ( (fFOVAnimRate < 0.0f && dH <= fFOVGoal) ||
(fFOVAnimRate > 0.0f && dH >= fFOVGoal) )
if ( (fFOVhAnimRate < 0.0f && dH <= fFOVhGoal) ||
(fFOVhAnimRate > 0.0f && dH >= fFOVhGoal) )
{
fFlags.ClearBit(kAnimateFOV);
dH = fFOVGoal;
dH = fFOVhGoal;
}
if ( (fFOVwAnimRate < 0.0f && dW <= fFOVwGoal) ||
(fFOVwAnimRate > 0.0f && dW >= fFOVwGoal) )
{
dW = fFOVwGoal;
}
fCamera->SetFOVw( (hsScalar)(dH * plVirtualCam1::GetAspectRatio()) );
fCamera->SetFOVh( dH );
if (dW == fFOVwGoal && dH == fFOVhGoal)
fFlags.ClearBit(kAnimateFOV);
fCamera->SetFOV( dW, dH );
}
@ -534,6 +555,14 @@ void plCameraBrain1::Write(hsStream* stream, hsResMgr* mgr)
stream->WriteSwapFloat(fZoomMin);
stream->WriteSwapFloat(fZoomMax);
}
hsScalar plCameraBrain1::IMakeFOVwZoom(hsScalar fovH) const
{
hsScalar num = hsTan(hsScalarDegToRad(fovH / 2)) * hsTan(hsScalarDegToRad(fCamera->GetFOVw() / 2));
hsScalar denom = hsTan(hsScalarDegToRad(fCamera->GetFOVh() / 2));
return (hsScalar)(2 * hsABS(hsScalarRadToDeg(atan(num / denom))));
}
hsBool plCameraBrain1::MsgReceive(plMessage* msg)
{
plCameraMsg* pCamMsg = plCameraMsg::ConvertNoRef(msg);
@ -542,16 +571,18 @@ hsBool plCameraBrain1::MsgReceive(plMessage* msg)
if (pCamMsg->Cmd(plCameraMsg::kStartZoomIn))
{
fFlags.SetBit(kAnimateFOV);
fFOVGoal = fZoomMin;
fFOVAnimRate = -1*fZoomRate;
fFOVhGoal = fZoomMin;
fFOVwGoal = IMakeFOVwZoom(fZoomMin);
fFOVwAnimRate = fFOVhAnimRate = -1*fZoomRate;
return true;
}
else
if (pCamMsg->Cmd(plCameraMsg::kStartZoomOut))
{
fFlags.SetBit(kAnimateFOV);
fFOVGoal = fZoomMax;
fFOVAnimRate = fZoomRate;
fFOVhGoal = fZoomMax;
fFOVwGoal = IMakeFOVwZoom(fZoomMax);
fFOVwAnimRate = fFOVhAnimRate = fZoomRate;
return true;
}
else
@ -635,8 +666,9 @@ hsBool plCameraBrain1::MsgReceive(plMessage* msg)
if (pCMsg->GetControlCode() == B_CAMERA_ZOOM_IN && fFlags.IsBitSet(kZoomEnabled))
{
fFlags.SetBit(kAnimateFOV);
fFOVGoal = fZoomMin;
fFOVAnimRate = -1*fZoomRate;
fFOVhGoal = fZoomMin;
fFOVwGoal = IMakeFOVwZoom(fZoomMin);
fFOVwAnimRate = fFOVhAnimRate = -1*fZoomRate;
fFOVEndTime = hsTimer::GetSysSeconds() + 60;
return true;
}
@ -644,8 +676,9 @@ hsBool plCameraBrain1::MsgReceive(plMessage* msg)
if (pCMsg->GetControlCode() == B_CAMERA_ZOOM_OUT && fFlags.IsBitSet(kZoomEnabled))
{
fFlags.SetBit(kAnimateFOV);
fFOVGoal = fZoomMax;
fFOVAnimRate = fZoomRate;
fFOVhGoal = fZoomMax;
fFOVwGoal = IMakeFOVwZoom(fZoomMax);
fFOVwAnimRate = fFOVhAnimRate = fZoomRate;
fFOVEndTime = hsTimer::GetSysSeconds() + 60;
return true;
}
@ -655,11 +688,12 @@ hsBool plCameraBrain1::MsgReceive(plMessage* msg)
if (fFlags.IsBitSet(kZoomEnabled))
{
fFlags.SetBit(kAnimateFOV);
fFOVGoal = fZoomMin + ((fZoomMax - fZoomMin) / 2);
if (fCamera->GetFOVw() >= fFOVGoal)
fFOVAnimRate = -1*fZoomRate;
fFOVhGoal = fZoomMin + ((fZoomMax - fZoomMin) / 2);
fFOVwGoal = IMakeFOVwZoom(fFOVhGoal);
if (fCamera->GetFOVh() >= fFOVhGoal)
fFOVwAnimRate = fFOVhAnimRate = -1*fZoomRate;
else
fFOVAnimRate = fZoomRate;
fFOVwAnimRate = fFOVhAnimRate = fZoomRate;
fFOVEndTime = hsTimer::GetSysSeconds() + 60;
}
return true;

7
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.h

@ -128,7 +128,7 @@ public:
void SetGoal(hsPoint3 pt) { fGoal = pt; }
void SetPOAGoal(hsPoint3 pt) { fPOAGoal = pt; }
void SetFOVGoal(hsScalar h, double t);
void SetFOVGoal(hsScalar w, hsScalar h, double t);
void SetZoomParams(hsScalar max, hsScalar min, hsScalar rate);
void SetXPanLimit(hsScalar x) {fXPanLimit = x;}
@ -183,6 +183,7 @@ protected:
hsScalar IClampVelocity(hsVector3* vel, hsScalar maxSpeed, double elapsedTime);
hsBool IShouldDecelerate(hsScalar decelSpeed, hsScalar curSpeed, hsScalar distToGoal);
hsScalar IMakeFOVwZoom(hsScalar fovH) const;
plCameraModifier1* fCamera;
plKey fSubjectKey;
@ -203,10 +204,10 @@ protected:
hsScalar fXPanLimit;
hsScalar fZPanLimit;
hsScalar fPanSpeed;
hsScalar fFOVGoal;
hsScalar fFOVwGoal, fFOVhGoal;
double fFOVStartTime;
double fFOVEndTime;
hsScalar fFOVAnimRate;
hsScalar fFOVwAnimRate, fFOVhAnimRate;
hsScalar fZoomRate;
hsScalar fZoomMax;
hsScalar fZoomMin;

15
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfCamera/plCameraModifier.cpp

@ -137,18 +137,26 @@ plSceneObject* plCameraModifier1::GetSubject()
return fSubObj;
}
void plCameraModifier1::SetFOV(hsScalar w, hsScalar h, bool fUpdateVCam)
{
fFOVw = w;
fFOVh = h;
if (plVirtualCam1::Instance() && fUpdateVCam)
plVirtualCam1::SetFOV(this);
}
void plCameraModifier1::SetFOVw(hsScalar f, hsBool fUpdateVCam)
{
fFOVw = f;
if (plVirtualCam1::Instance() && fUpdateVCam)
plVirtualCam1::SetFOV(fFOVw, fFOVh, this);
plVirtualCam1::SetFOV(this);
}
void plCameraModifier1::SetFOVh(hsScalar f, hsBool fUpdateVCam)
{
fFOVh = f;
if (plVirtualCam1::Instance() && fUpdateVCam)
plVirtualCam1::SetFOV(fFOVw, fFOVh, this);
plVirtualCam1::SetFOV(this);
}
hsBool plCameraModifier1::SetFaded(hsBool b)
@ -192,8 +200,9 @@ hsBool plCameraModifier1::MsgReceive(plMessage* msg)
double time2 = (double)pEventMsg->fEventTime;
time = hsABS(time - time2);
hsScalar h = fFOVInstructions[pEventMsg->fIndex]->GetConfig()->fFOVh;
hsScalar w = fFOVInstructions[pEventMsg->fIndex]->GetConfig()->fFOVw;
if (GetBrain())
GetBrain()->SetFOVGoal(h, time);
GetBrain()->SetFOVGoal(w, h, time);
}
plAnimCmdMsg* pAnimMsg = plAnimCmdMsg::ConvertNoRef(msg);

1
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfCamera/plCameraModifier.h

@ -130,6 +130,7 @@ public:
void SetSubworldPOA(hsPoint3 pos) { fLastSubPOA = pos; }
hsScalar GetFOVw() { return fFOVw; }
hsScalar GetFOVh() { return fFOVh; }
void SetFOV(hsScalar w, hsScalar h, bool fUpdateVCam = true);
void SetFOVw(hsScalar f, hsBool fUpdateVCam = true);
void SetFOVh(hsScalar f, hsBool fUpdateVCam = true);
hsBool GetInSubworld() { return fInSubLastUpdate; }

96
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfCamera/plVirtualCamNeu.cpp

@ -104,7 +104,7 @@ hsScalar plVirtualCam1::fFallTimerDelay = 0.25f;
hsBool plVirtualCam1::alwaysCutForColin = false;
hsBool plVirtualCam1::WalkPan3rdPerson = false;
hsBool plVirtualCam1::StayInFirstPersonForever = false;
float plVirtualCam1::fAspectRatio = fFOVw / fFOVh;
float plVirtualCam1::fAspectRatio = 4.f/3.f;
// #define STATUS_LOG
@ -287,58 +287,48 @@ void plVirtualCam1::SetOffset(float x, float y, float z)
}
// static function
void plVirtualCam1::SetFOV(hsScalar x, hsScalar y)
void plVirtualCam1::SetFOV(hsScalar w, hsScalar h)
{
float fovW = y * fAspectRatio;
static float fourXthree = (4.f/3.f);
fFOVw = fovW;
fFOVh = y;
if (! plVirtualCam1::Instance()->fPipe)
return;
fFOVh = h;
if (fAspectRatio == fourXthree)
fFOVw = w;
else
{
float scale = fAspectRatio / fourXthree;
fFOVw = (hsScalar)(2 * hsScalarRadToDeg(atan(scale * tan(hsScalarDegToRad(w/2)))));
}
plVirtualCam1::Instance()->SetFlags(plVirtualCam1::kSetFOV);
#ifdef STATUS_LOG
if (printFOV)
camLog->AddLineF("FOV changed by console command to %f", fFOVw);
#endif
}
// static function
void plVirtualCam1::SetFOV(hsScalar x, hsScalar y, plCameraModifier1* pCam)
void plVirtualCam1::SetFOV(plCameraModifier1* pCam)
{
if (plVirtualCam1::Instance()->GetCurrentCamera() != pCam)
return;
SetFOV(pCam->GetFOVw(), pCam->GetFOVh());
}
hsScalar diff = hsABS(fFOVw - x);
if (diff > 10.0f)
{
#ifdef STATUS_LOG
camLog->AddLineF("Radical FOV change of %f", diff);
#endif
}
float fovW = y * fAspectRatio;
fFOVw = fovW;
fFOVh = y;
void plVirtualCam1::Refresh()
{
plPipeline* pipe = plVirtualCam1::Instance()->fPipe;
SetAspectRatio((float)pipe->Width() / (float)pipe->Height());
}
if (! plVirtualCam1::Instance()->fPipe)
return;
plVirtualCam1::Instance()->SetFlags(plVirtualCam1::kSetFOV);
#ifdef STATUS_LOG
if (printFOV)
camLog->AddLineF("FOV changed to %f", fFOVw);
#endif
void plVirtualCam1::SetAspectRatio(float ratio)
{
fAspectRatio = ratio;
// resize the FOV accordingly
plCameraModifier1* pCam = plVirtualCam1::Instance()->GetCurrentCamera();
hsAssert(pCam, "CameraModifier1 shouldn't be nullptr?");
if (pCam)
SetFOV(pCam->GetFOVw(), pCam->GetFOVh());
}
// static function
void plVirtualCam1::SetDepth(hsScalar h, hsScalar y)
{
return;
@ -913,7 +903,7 @@ void plVirtualCam1::FirstPersonOverride()
#ifdef STATUS_LOG
camLog->AddLineF("Built-In First Person Camera Disabled");
#endif
SetFOV(GetCurrentStackCamera()->GetFOVw(), GetCurrentStackCamera()->GetFOVh(), GetCurrentStackCamera());
SetFOV(GetCurrentStackCamera());
GetCurrentStackCamera()->Push(!HasFlags(kAvatarWalking));
plAvatarInputInterface::GetInstance()->CameraInThirdPerson(true);
FreezeOutput(2);
@ -938,7 +928,7 @@ void plVirtualCam1::FirstPersonOverride()
fFirstPersonOverride = (plCameraModifier1*)pKey->GetObjectPtr();
GetCurrentStackCamera()->Pop();
fFirstPersonOverride->Push(!HasFlags(kAvatarWalking));
SetFOV(fFirstPersonOverride->GetFOVw(), fFirstPersonOverride->GetFOVh(), fFirstPersonOverride);
SetFOV(fFirstPersonOverride);
plAvatarInputInterface::GetInstance()->CameraInThirdPerson(false);
// no need to keep transitioning if we are currently...
if (fTransPos == POS_TRANS_FOLLOW)
@ -1178,12 +1168,12 @@ hsBool plVirtualCam1::MsgReceive(plMessage* msg)
#endif
if (fFirstPersonOverride)
{
SetFOV(fFirstPersonOverride->GetFOVw(), fFirstPersonOverride->GetFOVh(), fFirstPersonOverride);
SetFOV(fFirstPersonOverride);
fFirstPersonOverride->Push(!HasFlags(kAvatarWalking));
}
else
{
SetFOV(GetCurrentStackCamera()->GetFOVw(), GetCurrentStackCamera()->GetFOVh(), GetCurrentStackCamera());
SetFOV(GetCurrentStackCamera());
GetCurrentStackCamera()->Push(!HasFlags(kAvatarWalking));
}
@ -1243,7 +1233,7 @@ hsBool plVirtualCam1::MsgReceive(plMessage* msg)
pTrans->fCutPOA = pTrans->fCutPos = true;
StartTransition(pTrans);
delete(pTrans);
SetFOV(fPythonOverride->GetFOVw(), fPythonOverride->GetFOVh(), fPythonOverride);
SetFOV(fPythonOverride);
ClearFlags(kFirstPersonEnabled);
}
}
@ -1289,7 +1279,7 @@ hsBool plVirtualCam1::MsgReceive(plMessage* msg)
#ifdef STATUS_LOG
camLog->AddLineF("Forcing 3rd Person from scripts");
#endif
SetFOV(GetCurrentStackCamera()->GetFOVw(), GetCurrentStackCamera()->GetFOVh(), GetCurrentStackCamera());
SetFOV(GetCurrentStackCamera());
}
}
}
@ -1320,7 +1310,7 @@ hsBool plVirtualCam1::MsgReceive(plMessage* msg)
#ifdef STATUS_LOG
camLog->AddLineF("Forcing 3rd Person from code");
#endif
SetFOV(GetCurrentStackCamera()->GetFOVw(), GetCurrentStackCamera()->GetFOVh(), GetCurrentStackCamera());
SetFOV(GetCurrentStackCamera());
}
ClearFlags(kFirstPersonEnabled);
#ifdef STATUS_LOG
@ -1384,6 +1374,11 @@ hsBool plVirtualCam1::MsgReceive(plMessage* msg)
}
}
}
else
if (pCam->Cmd(plCameraMsg::kRefreshFOV))
{
Refresh();
}
}
plGenRefMsg* pRefMsg = plGenRefMsg::ConvertNoRef(msg);
if (pRefMsg )
@ -1678,7 +1673,7 @@ void plVirtualCam1::PushCamera(plCameraModifier1* pCam, hsBool bDefault)
camLog->AddLineF("Camera %s is now the DEFAULT camera for this age", pCam->GetKeyName());
#endif
}
SetFOV(GetCurrentStackCamera()->GetFOVw(), GetCurrentStackCamera()->GetFOVh(), GetCurrentStackCamera());
SetFOV(GetCurrentStackCamera());
}
void plVirtualCam1::PopCamera(plCameraModifier1* pCam)
@ -1819,7 +1814,7 @@ void plVirtualCam1::PopCamera(plCameraModifier1* pCam)
}
}
if (!InTransition())
SetFOV(GetCurrentStackCamera()->GetFOVw(), GetCurrentStackCamera()->GetFOVh(), GetCurrentStackCamera());
SetFOV(GetCurrentStackCamera());
}
void plVirtualCam1::PopAll()
@ -1838,7 +1833,6 @@ void plVirtualCam1::StartTransition(CamTrans* transition)
{
GetCurrentStackCamera()->GetBrain()->SetFlags(plCameraBrain1::kCutPOAOnce);
GetCurrentStackCamera()->GetBrain()->SetFlags(plCameraBrain1::kCutPosOnce);
SetFOV(GetCurrentStackCamera()->GetFOVw(), GetCurrentStackCamera()->GetFOVh(), GetCurrentStackCamera());
fXPanLimit = GetCurrentStackCamera()->GetBrain()->GetXPanLimit();
fZPanLimit = GetCurrentStackCamera()->GetBrain()->GetZPanLimit();
StartInterpPanLimits();
@ -1984,12 +1978,8 @@ void plVirtualCam1::StartTransition(CamTrans* transition)
else
dist.Set(&(fTransitionCamera->GetTargetPos() - pCam->GetTargetPos()));
time = (double)(dist.Magnitude() / pBrain->GetVelocity());
// set up the transition camera to the current FOV
fTransitionCamera->SetFOVh(GetFOVh(), false);
fTransitionCamera->SetFOVw(GetFOVw(), false);
fTransitionCamera->GetBrain()->SetFOVGoal(pCam->GetFOVh(), time);
time = (dist.Magnitude() / pBrain->GetVelocity());
fTransitionCamera->GetBrain()->SetFOVGoal(pCam->GetFOVw(), pCam->GetFOVh(), time);
}
StartInterpPanLimits();

7
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfCamera/plVirtualCamNeu.h

@ -121,16 +121,17 @@ public:
virtual hsBool MsgReceive(plMessage* msg);
static void SetFOV(hsScalar w, hsScalar h);
static void SetFOV(hsScalar w, hsScalar h, plCameraModifier1* pCam);
static void SetFOV(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 SetOffset(float x, float y, float z);
static void SetAspectRatio(float aspect) { fAspectRatio = aspect; }
static void Refresh();
static float GetAspectRatio() { return fAspectRatio; }
static void SetAspectRatio(float ratio);
hsBool InTransition() { return fTransPos != POS_TRANS_OFF; }
plCameraModifier1* GetCurrentCamera();
plCameraModifier1* GetCurrentStackCamera();

19
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfPython/cyCamera.cpp

@ -263,7 +263,7 @@ void cyCamera::SetFOV(hsScalar fov, double t)
plCameraBrain1* camBrain = curCam->GetBrain();
if (camBrain)
{
camBrain->SetFOVGoal(fov,t);
camBrain->SetFOVGoal(0.f,fov,t);
}
}
}
@ -370,17 +370,12 @@ hsBool cyCamera::IsStayInFirstPerson()
return false;
}
void cyCamera::SetAspectRatio(float aspectratio)
void cyCamera::RefreshFOV()
{
plVirtualCam1::SetAspectRatio(aspectratio);
}
float cyCamera::GetAspectRatio()
{
return plVirtualCam1::GetAspectRatio();
}
plCameraMsg* pMsg = new plCameraMsg();
pMsg->SetSender(fSender);
pMsg->SetCmd(plCameraMsg::kRefreshFOV);
pMsg->Send(fTheCam);
void cyCamera::RefreshFOV()
{
plVirtualCam1::SetFOV(plVirtualCam1::GetFOVw(), plVirtualCam1::GetFOVh());
}
}

5
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfPython/cyCamera.h

@ -55,6 +55,7 @@ class pyKey;
#include <python.h>
#include "pyGlueHelpers.h"
#include "../pfCamera/plVirtualCamNeu.h"
class cyCamera
{
@ -114,8 +115,8 @@ public:
virtual void SetStayInFirstPerson(hsBool state);
virtual hsBool IsStayInFirstPerson();
virtual void SetAspectRatio(float aspectratio);
virtual float GetAspectRatio();
virtual void SetAspectRatio(float aspectratio) { plVirtualCam1::SetAspectRatio(aspectratio); }
virtual float GetAspectRatio() const { return plVirtualCam1::GetAspectRatio(); }
virtual void RefreshFOV();
};

1
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/NucleusLib/pnMessage/plCameraMsg.h

@ -207,6 +207,7 @@ public:
kNonPhysOn,
kNonPhysOff,
kResetPanning,
kRefreshFOV,
kNumCmds
};

6
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp

@ -2209,8 +2209,7 @@ void plDXPipeline::IResetToDefaults(D3DPRESENT_PARAMETERS *params)
plBitmap::SetGlobalLevelChopCount(2 - fDefaultPipeParams.TextureQuality);
// adjust camera properties
plVirtualCam1::SetAspectRatio((float)fSettings.fOrigWidth / (float)fSettings.fOrigHeight);
plVirtualCam1::SetFOV(plVirtualCam1::GetFOVw(), plVirtualCam1::GetFOVh());
plVirtualCam1::Refresh();
// fire off a message to the client so we can write defaults to the ini file, and adjust the window size
plKey clientKey = hsgResMgr::ResMgr()->FindKey( kClient_KEY );
@ -2375,8 +2374,7 @@ void plDXPipeline::ResetDisplayDevice(int Width, int Height, int ColorDepth, hsB
fDeviceLost = true;
fForceDeviceReset = true;
plVirtualCam1::SetAspectRatio((float)Width / (float)Height);
plVirtualCam1::SetFOV(plVirtualCam1::GetFOVw(), plVirtualCam1::GetFOVh());
plVirtualCam1::Refresh();
IResetDevice();

Loading…
Cancel
Save