resonance 1.0.1
Loading...
Searching...
No Matches
pscam.h
Go to the documentation of this file.
1#pragma once
2
3#include "math/transform.h"
4#include "math/vector2.h"
5#include "math/vector3.h"
6#include "rnd/cam.h"
7
8class HxStr;
9namespace Rnd {
10class Tex;
11}
12
13namespace Rnd {
14
33class PsCam : public Cam {
34public:
44 static PsCam *sDefault;
45
53 explicit PsCam(const HxStr &name);
54
59 virtual ~PsCam();
60
76 virtual int DrawShowing();
77
90 virtual Vector2 ScreenToPixels(const Vector2 &ptScreen);
91
102 virtual void UpdateTargetAspect();
103
115 virtual void SetTargetTex(Tex *pTex);
116
128 static Cam *NewCam(const HxStr &name);
129
141 static void Init();
142
154 static void Terminate();
155};
156
157inline void PsCam::Terminate() {
158 delete PsCam::sDefault;
160}
161
162// The globals below are the draw state PsCam::DrawShowing() leaves for the software and VU1 paths.
163// Every title is inferred from the computation that fills the global, because the image
164// retains no name for any of them.
165
174
182
190
198
206
214
222
234
242
249extern float g_flCamNear;
250
259extern int g_nScissorX0;
260
265extern int g_nScissorX1;
266
271extern int g_nScissorY0;
272
277extern int g_nScissorY1;
278
279} // namespace Rnd
Heap-allocated NUL-terminated string.
Definition hxstr.h:41
Cam(const HxStr &name)
Construct a camera with the default projection.
virtual void UpdateTargetAspect()
Take the aspect ratio from the render target and rebuild the projection.
virtual int DrawShowing()
Make this camera the one the frame is drawn through and submit its display registers.
virtual void SetTargetTex(Tex *pTex)
Set the texture this camera draws into, or none to draw into the frame buffer.
virtual ~PsCam()
virtual Vector2 ScreenToPixels(const Vector2 &ptScreen)
Place a point of the screen rectangle in render target pixels.
static void Init()
Install the PlayStation 2 camera factory and build the default camera.
PsCam(const HxStr &name)
Construct a camera with the default projection.
static void Terminate()
Undo what Init() installs.
Definition pscam.h:157
static Cam * NewCam(const HxStr &name)
Build a camera the class registry vends.
static PsCam * sDefault
Camera the renderer falls back on when a scene selects none.
Definition pscam.h:44
Texture, as a bitmap path plus the load state of its mip levels.
Definition tex.h:43
The rendering engine.
Definition animhelper.h:3
Transform g_viewportBiasedXfm
g_viewportXfm with a small depth bias added to the translation.
void RegisterCamClass()
Point Cam::sNew at Cam::NewCam(), clear Cam::sCurrent, and register the "Cam" class with Rnd::Manager...
Definition cam.h:631
float g_flCamNear
Near plane distance of the camera last drawn through.
int g_nScissorY0
int g_nScissorX0
Scissor rectangle of the camera last drawn through, in GS primitive coordinates of 1/16 pixel.
Vector3 g_particleProjectScale
The widened projection scale on each axis, with y negated.
int g_nScissorY1
Vector3 g_guardBandScale
Factor the view is widened by on each axis before clipping.
int g_nScissorX1
Transform g_viewProjectUnscaledXfm
The same transform without the guard band widening.
Vector3 g_invGuardBandScale
Reciprocal of g_guardBandScale, left unchanged when either axis of it is zero.
Transform g_viewportXfm
Clip to GS coordinate transform, scaled by the guard band.
Transform g_viewProjectXfm
Camera to clip transform, the local projection widened by the guard band and then preceded by the cam...
Vector3 g_particleScreenScale
Screen scale of a particle's extent, the widened projection scale times the viewport scale.
Transform g_viewportUnscaledXfm
The same transform without the guard band scaling.
Affine transform stored as three basis rows and a translation row.
Definition transform.h:14
Two-component vector, used for texture coordinates.
Definition vector2.h:10
Three-component vector, padded to a PlayStation 2 quadword.
Definition vector3.h:12