mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-14 02:27:40 -04:00
Update the FOV when using plCaptureRender
This commit is contained in:
@ -309,6 +309,7 @@ void plVirtualCam1::Refresh()
|
|||||||
{
|
{
|
||||||
plPipeline* pipe = plVirtualCam1::Instance()->fPipe;
|
plPipeline* pipe = plVirtualCam1::Instance()->fPipe;
|
||||||
SetAspectRatio((float)pipe->Width() / (float)pipe->Height());
|
SetAspectRatio((float)pipe->Width() / (float)pipe->Height());
|
||||||
|
plVirtualCam1::Instance()->SetOutputFOV();
|
||||||
}
|
}
|
||||||
|
|
||||||
void plVirtualCam1::SetAspectRatio(float ratio)
|
void plVirtualCam1::SetAspectRatio(float ratio)
|
||||||
@ -845,18 +846,7 @@ void plVirtualCam1::Output()
|
|||||||
targetMatrix.GetInverse(&inverse);
|
targetMatrix.GetInverse(&inverse);
|
||||||
fPipe->SetWorldToCamera( targetMatrix, inverse );
|
fPipe->SetWorldToCamera( targetMatrix, inverse );
|
||||||
if (HasFlags(kSetFOV)) // are we changing the field of view?
|
if (HasFlags(kSetFOV)) // are we changing the field of view?
|
||||||
{
|
SetOutputFOV();
|
||||||
ClearFlags(kSetFOV);
|
|
||||||
fPipe->SetFOV(fFOVw,fFOVh);
|
|
||||||
fPipe->RefreshMatrices();
|
|
||||||
if (foutLog)
|
|
||||||
{
|
|
||||||
fprintf(foutLog, "****************************************************************\n");
|
|
||||||
fprintf(foutLog, "FOV changed to %f %f\n",fFOVh, fFOVw);
|
|
||||||
fprintf(foutLog, "****************************************************************\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
/* if (foutLog)
|
/* if (foutLog)
|
||||||
{
|
{
|
||||||
fprintf(foutLog, "output pos %f %f %f\n", fOutputPos.fX,fOutputPos.fY,fOutputPos.fZ);
|
fprintf(foutLog, "output pos %f %f %f\n", fOutputPos.fX,fOutputPos.fY,fOutputPos.fZ);
|
||||||
@ -865,6 +855,19 @@ void plVirtualCam1::Output()
|
|||||||
} */
|
} */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void plVirtualCam1::SetOutputFOV()
|
||||||
|
{
|
||||||
|
ClearFlags(kSetFOV);
|
||||||
|
fPipe->SetFOV(fFOVw, fFOVh);
|
||||||
|
fPipe->RefreshMatrices();
|
||||||
|
if (foutLog)
|
||||||
|
{
|
||||||
|
fprintf(foutLog, "****************************************************************\n");
|
||||||
|
fprintf(foutLog, "FOV changed to %f %f\n", fFOVh, fFOVw);
|
||||||
|
fprintf(foutLog, "****************************************************************\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void plVirtualCam1::Init()
|
void plVirtualCam1::Init()
|
||||||
{
|
{
|
||||||
plgDispatch::Dispatch()->RegisterForExactType(plEvalMsg::Index(), GetKey());
|
plgDispatch::Dispatch()->RegisterForExactType(plEvalMsg::Index(), GetKey());
|
||||||
|
@ -81,9 +81,10 @@ protected:
|
|||||||
|
|
||||||
|
|
||||||
void Output();
|
void Output();
|
||||||
|
void SetOutputFOV();
|
||||||
void IUpdate();
|
void IUpdate();
|
||||||
void INext();
|
void INext();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum flags
|
enum flags
|
||||||
{
|
{
|
||||||
|
@ -54,6 +54,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
|||||||
#include "hsResMgr.h"
|
#include "hsResMgr.h"
|
||||||
#include "pnKeyedObject/plUoid.h"
|
#include "pnKeyedObject/plUoid.h"
|
||||||
|
|
||||||
|
#include "pfCamera/plVirtualCamNeu.h"
|
||||||
#include "pfGameGUIMgr/pfGameGUIMgr.h"
|
#include "pfGameGUIMgr/pfGameGUIMgr.h"
|
||||||
|
|
||||||
#else // MF_FRONTBUFF_CAPTURE
|
#else // MF_FRONTBUFF_CAPTURE
|
||||||
@ -89,12 +90,14 @@ void plCaptureRenderRequest::Render(plPipeline* pipe, plPageTreeMgr* pageMgr)
|
|||||||
// Clear our render target
|
// Clear our render target
|
||||||
// Render the scene
|
// Render the scene
|
||||||
pipe->PushRenderRequest(this);
|
pipe->PushRenderRequest(this);
|
||||||
|
plVirtualCam1::Refresh();
|
||||||
|
|
||||||
pipe->ClearRenderTarget();
|
pipe->ClearRenderTarget();
|
||||||
|
|
||||||
pageMgr->Render(pipe);
|
pageMgr->Render(pipe);
|
||||||
|
|
||||||
pipe->PopRenderRequest(this);
|
pipe->PopRenderRequest(this);
|
||||||
|
plVirtualCam1::Refresh();
|
||||||
|
|
||||||
// set up state so we can clear the z-buffer for every gui dialog (and therefore not have it
|
// set up state so we can clear the z-buffer for every gui dialog (and therefore not have it
|
||||||
// be obscured by other geometry)
|
// be obscured by other geometry)
|
||||||
|
Reference in New Issue
Block a user