resonance 1.0.1
Loading...
Searching...
No Matches
Rnd::Cam Class Reference

Camera. More...

#include <cam.h>

Inheritance diagram for Rnd::Cam:
Collaboration diagram for Rnd::Cam:

Classes

struct  Rect
 Rectangle the projected image is placed in. More...

Public Member Functions

void * operator new (size_t nSize)
 Allocate a camera from the tagged heap under the tag "Rnd::Cam".
void operator delete (void *pBlock)
 Release a camera to the tagged heap.
 Cam (const HxStr &name)
 Construct a camera with the default projection.
virtual ~Cam ()
 Clear Cam::sCurrent when it addresses this camera and release the render target.
void UpdateProjection ()
 Build the local frustum and both local projection matrices.
void UpdateWorldProject ()
 Compose the world projection, its inverse, and the world frustum.
Segment ScreenToRay (const Vector2 &ptScreen, float flLength)
 Build the segment under a point of the screen rectangle.
Vector2 ProjectToUnit (const Vector3 &pt)
 Place a world point in the unit square of the projected image.
Vector3 UnprojectFar (const Vector2 &ptUnit)
 Carry a point of the unit square of the projected image onto the far side of the projection.
void SetScreenRect (const Rect &rect)
 Replace mScreenRect and rebuild the projection.
void SetFrustum (float flNear, float flFar, float flFov)
 Set the clip distances and the field of view, then rebuild the projection.
float GetNearPlane () const
 Report the near clip distance.
float GetFarPlane () const
 Report the far clip distance.
float GetFov () const
 Report the field of view, zero for an orthographic projection.
void SetTargetTex (Tex *pTex)
 Set the texture this camera draws into, or none to draw into the frame buffer.
virtual Vector2 ScreenToPixels (const Vector2 &ptScreen)
 Place a point of the screen rectangle in render target pixels.
virtual void UpdateTargetAspect ()
 Take the aspect ratio from the render target and rebuild the projection.
virtual const HxStr & ClassName () const
 Report the class key a .rnd file writes for a camera.
virtual void DumpText (Dbg &sink)
 Write a description of this camera to sink.
virtual void Replace (Object *pFrom, Object *pTo)
 Repoint the render target when the object it addressed is replaced.
virtual int UpdateWorldXfm (Transformable *pParent, int nForce)
 Recompose the world transform and, when it changed, the world projection.
virtual void Save (Stream &stream)
 Write this camera's serialised form to stream.
virtual void Copy (const Object *pSource, unsigned nFlags)
 Copy the state of pSource into this camera.
virtual void Load (Stream &stream)
 Read this camera's serialised form from stream.
Public Member Functions inherited from Rnd::Drawable
 Drawable ()
 Construct a visible drawable with no children.
virtual ~Drawable ()
 Drop this object's references on its children.
void Draw ()
 Draw this object followed by each of its children.
Drawable * Parent ()
 Report the drawable that draws this one.
void AddDraw (Drawable *pDraw, Drawable *pBefore)
 Insert pDraw into mDraws in front of pBefore.
void AddDraw (Drawable *pDraw)
 Insert pDraw at the front of mDraws.
void RemoveDraw (Drawable *pDraw)
 Erase pDraw from mDraws.
void RemoveAllDraws ()
 Empty mDraws, dropping this object's reference on every entry.
void MoveDraw (Drawable *pDraw, int nSteps)
 Move pDraw nSteps places later in mDraws, or earlier for a negative count.
virtual void SetShowing (int nShowing)
 Set whether this object draws at all.
void SetShowingRecursive (int nShowing)
 Set whether this object and every drawable beneath it in mDraws draw at all.
virtual void SetHighlight (int nHighlight)
 Set whether this object draws with its highlight treatment.
int GetHighlight () const
 Report the highlight flag.
int GetShowing () const
 Report the showing flag.
std::list< Drawable * > & GetDraws ()
 Report the child list.
Public Member Functions inherited from Rnd::Object
 Object ()
 Construct an unnamed object.
 Object (const HxStr &name)
 Construct an object and register it under name.
virtual ~Object ()
 Erase the registry entry and release the name buffer.
void SetName (const HxStr &name)
 Re-register this object under a different name.
void AddRef (Object *pReferrer)
 Register pReferrer as a store of a pointer to this object.
void RemoveRef (Object *pReferrer)
 Drop one registration made by AddRef().
Public Member Functions inherited from Rnd::Transformable
 Transformable ()
 Construct a dirty transformable with identity transforms and no children.
virtual ~Transformable ()
 Drop this object's references on its children.
void AddTrans (Transformable *pTrans)
 Append pTrans to mTransList and mark it dirty.
void RemoveTrans (Transformable *pTrans)
 Erase pTrans from mTransList.
void RemoveAllTranses ()
 Drop this object's reference on every mTransList entry and empty the list.
Transformable * Parent ()
 Report the transformable that positions this one.
virtual void SetBillboard (int nBillboard)
 Set the billboard mode and mark the transform dirty.
void SetOrigin (const float *pOrigin)
 Set the origin row and mark the transform dirty.
float * GetDrawXfm ()
 Build the transform this object draws with and return it.
Public Member Functions inherited from Rnd::Collideable
 Collideable ()
 Construct a collideable with no children.
virtual ~Collideable ()
 Drop this object's references on its children.
Collideable * Parent ()
 Report the collideable that hit-tests this one.
void AddCollide (Collideable *pCollide)
 Append pCollide to mCollides.
void RemoveCollide (Collideable *pCollide)
 Erase pCollide from mCollides.
virtual void FindCollisions (const Segment &ray, std::list< Collision > &collisions)
 Test a segment against this object and append what it strikes to collisions.

Static Public Member Functions

static Cam * NewCam (const HxStr &name)
 Build a camera the class registry vends.
Static Public Member Functions inherited from Rnd::Drawable
static Drawable * Find (const HxStr &name)
 Resolve a registry key to a drawable.

Public Attributes

Vector3 mWorldToCam [kXfmRowCount]
 Inverse of the world transform, which maps world space into camera space.
Vector3 mLocalProject [kXfmRowCount]
 Projection from camera space onto the screen rectangle.
Vector3 mWorldProject [kXfmRowCount]
 mWorldToCam followed by mLocalProject.
Vector3 mInvWorldProject [kXfmRowCount]
 mInvLocalProject followed by the world transform.
Frustum mWorldFrustum
 The view volume in world space.
Rect mScreenRect
 Fraction of the render target the projected image is placed in.
Tex * mpTargetTex
 Texture this camera draws into, or null to draw into the frame buffer.
Public Attributes inherited from Rnd::Drawable
int mShowing
Public Attributes inherited from Rnd::Object
HxStr mName
int mInternal
Public Attributes inherited from Rnd::Transformable
float mLocalXfm [kXfmRowCount][kXfmRowFloatCount]
 Transform this object is positioned by, before the parent transform is applied.
float mWorldXfm [kXfmRowCount][kXfmRowFloatCount]
 Composed world transform.
int mDirty
 Set by every writer of a transform field and cleared once UpdateWorldXfm has recomposed.

Static Public Attributes

static Cam * sCurrent
 Camera the frame is being drawn through.
static Cam *(* sNew )(const HxStr &name)
 Creator the registered "Cam" class builds through.
static HxStr sClassName
 Registered class name of Rnd::Cam, the string "Cam".

Protected Member Functions

virtual void FindCollisions (const Vector2 &point, std::list< Collision > &collisions)
 Report whether a screen point lies inside the screen rectangle.
virtual int DrawShowing ()
 Make this camera the one the frame is drawn through.
Protected Member Functions inherited from Rnd::Drawable
void ReleaseDrawsRefs ()
 Drop this object's reference on every mDraws entry without emptying the list.
Protected Member Functions inherited from Rnd::Object
void ReleaseAllRefs ()
 Tell every referrer to drop its pointer to this object.
Protected Member Functions inherited from Rnd::Transformable
void AdoptXfmFrom (const Transformable &owner)
 Adopt the transform of an owner this object is being detached from.
void ReleaseTransRefs ()
 Drop this object's reference on every mTransList entry without emptying the list.
Protected Member Functions inherited from Rnd::Collideable
void ReleaseCollidesRefs ()
 Drop this object's reference on every mCollides entry without emptying the list.

Protected Attributes

Frustum mLocalFrustum
float mNearPlane
float mFarPlane
float mFov
float mYRatio
Vector2 mZRange
Protected Attributes inherited from Rnd::Object
std::list< Object * > mRefs
Protected Attributes inherited from Rnd::Transformable
float mOrigin [kXfmRowFloatCount]
int mBillboard

Additional Inherited Members

Public Types inherited from Rnd::Transformable
enum  Billboard {
  kBillboardNone = 0 , kBillboardX = 1 , kBillboardY = 2 , kBillboardZ = 4 ,
  kBillboardXZ = 8 , kBillboardXYZ = 16 , kBillboardSimpleXYZ = 32 , kBillboardLocalRotate = 64 ,
  kBillboardScaleX = 129 , kBillboardScaleY = 130 , kBillboardScaleZ = 132 , kBillboardScaleXZ = 136 ,
  kBillboardScaleXYZ = 144 , kBillboardScaleSimpleXYZ = 160
}
 Mode mBillboard selects, recovered from the name dumper at 0x004f26f0. More...

Detailed Description

Camera.

Its RTTI descriptor is at 0x008eeeb8. It has three public non-virtual bases: Rnd::Drawable at offset 0, Rnd::Transformable at 0x20, and Rnd::Collideable at 0xd0. The class is 0x330 bytes. The factory at 0x004b2470 proves that size by allocating exactly that much under the tag "Rnd::Cam". The virtual Rnd::Object subobject sits at 0x310. The constructor proves the offset by writing that address into all three virtual-base pointers.

Each matrix and each frustum member is quadword aligned in the original. The four bytes between the end of the Rnd::Collideable subobject at 0xdc and the first matrix at 0xe0 are the padding that alignment produces rather than a member.

The member titles come from the text DumpText() writes: "nearPlane:", " farPlane:", " fov:", "yRatio:", "screenRect:", "zRange:", " targetTex:", " localProject:", "worldProject:", and "invWorldProject:". Both frustum member names come from the same dump. The names of the two matrices the dump omits come from what builds them. That is, 0xe0 is the inverse of the world transform and 0x160 is the inverse of the local projection.

Four vtables belong to the class. The six-entry table at 0x00820958 is addressed by the Rnd::Drawable vptr at 0x10 and stores the two virtuals declared here after the three Rnd::Drawable ones. The three-entry table at 0x00820938 is addressed by the Rnd::Transformable vptr at 0xc8, the three-entry table at 0x00820918 by the Rnd::Collideable vptr at 0xd8, and the eight-entry table at 0x00820990 by the Rnd::Object subobject vptr, each entry with the adjustment back to the Cam pointer.

The routine at 0x004b1ff0 is an out-of-line copy of an inline accessor that returns Cam::sCurrent. It has no caller, because every reader in the image loads the global directly.

Constructor & Destructor Documentation

◆ Cam()

Rnd::Cam::Cam ( const HxStr & name)
explicit

Construct a camera with the default projection.

The near plane starts at 1.0, the far plane at 1000.0, the field of view at a right angle, the vertical ratio at 0.75, the depth range at 0.0 to 1.0, and the screen rectangle at the whole target. Every projection matrix retains only its fourth column, and the final call builds them all.

Parameters
nameThe registry key for this object.
Ghidra address:
NTSC-U/C: 0x004aeb70
Ghidra address:
PAL: 0x004ecd60

◆ ~Cam()

virtual Rnd::Cam::~Cam ( )
virtual

Clear Cam::sCurrent when it addresses this camera and release the render target.

Ghidra address:
NTSC-U/C: 0x004af668
Ghidra address:
PAL: 0x004ed858

Member Function Documentation

◆ operator new()

void * Rnd::Cam::operator new ( size_t nSize)

Allocate a camera from the tagged heap under the tag "Rnd::Cam".

Parameters
nSizeThe object size, which the compiler supplies.
Returns
The block.
Ghidra address:
NTSC-U/C: 0x004b1e90
Ghidra address:
PAL: 0x004f00b8

◆ operator delete()

void Rnd::Cam::operator delete ( void * pBlock)

Release a camera to the tagged heap.

Parameters
pBlockThe block.
Ghidra address:
NTSC-U/C: 0x004b1eb0
Ghidra address:
PAL: 0x004f00d8

◆ UpdateProjection()

void Rnd::Cam::UpdateProjection ( )

Build the local frustum and both local projection matrices.

The aspect ratio is the vertical ratio scaled by the height of the screen rectangle and divided by its width. A field of view of zero selects an orthographic projection and any other value a perspective one, the second scaling by the reciprocal tangent of the half angle. Either way the matrices map camera space x to screen x, camera space y to depth, and camera space z to negated screen y, which establishes that this engine looks down its y axis with z upwards. UpdateWorldProject() runs afterwards.

Ghidra address:
NTSC-U/C: 0x004afac0
Ghidra address:
PAL: 0x004edcb0

◆ UpdateWorldProject()

void Rnd::Cam::UpdateWorldProject ( )

Compose the world projection, its inverse, and the world frustum.

The inverse of the world transform becomes the world-to-camera matrix, the six local frustum planes are moved into world space, the world projection is the world-to-camera matrix followed by the local projection, and the inverse world projection is the inverse local projection followed by the world transform.

Ghidra address:
NTSC-U/C: 0x004afc18
Ghidra address:
PAL: 0x004ede08

◆ ScreenToRay()

Segment Rnd::Cam::ScreenToRay ( const Vector2 & ptScreen,
float flLength )

Build the segment under a point of the screen rectangle.

The point is moved into the unit square of mScreenRect, then onto the far side of the projection through mInvWorldProject. A perspective camera starts the segment at its world position and runs it flLength along the direction to that far point. An orthographic camera starts the segment at the far point itself and runs it flLength along its world y axis.

The image has no caller. The title is inferred.

Parameters
ptScreenThe point, in the coordinates the screen rectangle is expressed in.
flLengthThe length of the segment.
Returns
The segment.
Ghidra address:
NTSC-U/C: 0x004afe00
Ghidra address:
PAL: 0x004edff0

◆ ProjectToUnit()

Vector2 Rnd::Cam::ProjectToUnit ( const Vector3 & pt)
inline

Place a world point in the unit square of the projected image.

The point is carried through mWorldProject, divided by its depth, and mapped from -1..1 onto 0..1. A point at zero depth skips the division, which leaves the result indeterminate.

Inline. CreditsRoll's two classifiers expand it, and the out-of-line copy in the camera's translation unit has no caller. The title is inferred.

Parameters
ptThe world point.
Returns
The point in the unit square.
Ghidra address:
NTSC-U/C: 0x004b2008
Ghidra address:
PAL: 0x004f0230

◆ UnprojectFar()

Vector3 Rnd::Cam::UnprojectFar ( const Vector2 & ptUnit)

Carry a point of the unit square of the projected image onto the far side of the projection.

The point is mapped from 0..1 onto -1..1 with a depth of one and carried through mInvWorldProject. The screen rectangle is not applied.

The image has no caller. The title is inferred.

Parameters
ptUnitThe point in the unit square.
Returns
The world point.
Ghidra address:
NTSC-U/C: 0x004b2118
Ghidra address:
PAL: 0x004f0340

◆ SetScreenRect()

void Rnd::Cam::SetScreenRect ( const Rect & rect)

Replace mScreenRect and rebuild the projection.

The image has no caller. The title is inferred.

Parameters
rectThe fraction of the render target the projected image is placed in.
Ghidra address:
NTSC-U/C: 0x004b2190
Ghidra address:
PAL: 0x004f03b8

◆ SetFrustum()

void Rnd::Cam::SetFrustum ( float flNear,
float flFar,
float flFov )

Set the clip distances and the field of view, then rebuild the projection.

The near distance is raised to a thousandth of the far distance when it is smaller. UpdateProjection() runs afterwards. AppTunnel and TnlCameraRig are the callers. The title is inferred.

Parameters
flNearThe near clip distance.
flFarThe far clip distance.
flFovThe field of view, zero for an orthographic projection.
Ghidra address:
NTSC-U/C: 0x004b26e0
Ghidra address:
PAL: 0x004f0908

◆ GetNearPlane()

float Rnd::Cam::GetNearPlane ( ) const
inline

Report the near clip distance.

The out-of-line copy has no callers. AppTunnel's constructor inlines it.

Returns
The distance.
Ghidra address:
NTSC-U/C: 0x004b23a8
Ghidra address:
PAL: 0x004f05d0

◆ GetFarPlane()

float Rnd::Cam::GetFarPlane ( ) const
inline

Report the far clip distance.

The out-of-line copy has no callers. AppTunnel's constructor inlines it.

Returns
The distance.
Ghidra address:
NTSC-U/C: 0x004b23b0
Ghidra address:
PAL: 0x004f05d8

◆ GetFov()

float Rnd::Cam::GetFov ( ) const
inline

Report the field of view, zero for an orthographic projection.

The out-of-line copy has no callers. AppTunnel's constructor inlines it.

Returns
The field of view.
Ghidra address:
NTSC-U/C: 0x004b23b8
Ghidra address:
PAL: 0x004f05e0

◆ SetTargetTex()

void Rnd::Cam::SetTargetTex ( Tex * pTex)

Set the texture this camera draws into, or none to draw into the frame buffer.

The previous target loses its reference on this camera and the new one gains one. A new target is then resized, through a call that takes its width, its height, and a depth capped at 0x20, after which the render target is acquired and UpdateTargetAspect() runs.

The routine is not virtual. Rnd::PsCam declares a virtual of the same title that chains here, which is what places that virtual in a slot of its own rather than in one of these.

Parameters
pTexThe render target, or null to draw into the frame buffer.
Ghidra address:
NTSC-U/C: 0x004ad6f8
Ghidra address:
PAL: 0x004eb898

◆ ScreenToPixels()

virtual Vector2 Rnd::Cam::ScreenToPixels ( const Vector2 & ptScreen)
virtual

Place a point of the screen rectangle in render target pixels.

Vtable slot 4 of the Rnd::Drawable table. This implementation writes nothing and returns its result slot untouched. The value a caller receives is therefore indeterminate, and only Rnd::PsCam::ScreenToPixels() produces one.

Parameters
ptScreenThe point, in the coordinates the screen rectangle is expressed in.
Returns
The same point in render target pixels.
Ghidra address:
NTSC-U/C: 0x004b2000
Ghidra address:
PAL: 0x004f0228

Reimplemented in Rnd::PsCam.

◆ UpdateTargetAspect()

virtual void Rnd::Cam::UpdateTargetAspect ( )
virtual

Take the aspect ratio from the render target and rebuild the projection.

Vtable slot 5 of the Rnd::Drawable table. With a render target the vertical ratio becomes the target height divided by its width. With none the ratio is untouched, and Rnd::PsCam overrides this routine to supply a default.

Ghidra address:
NTSC-U/C: 0x004b2738
Ghidra address:
PAL: 0x004f0960

Reimplemented in Rnd::PsCam.

◆ ClassName()

virtual const HxStr & Rnd::Cam::ClassName ( ) const
virtual

Report the class key a .rnd file writes for a camera.

The returned string is the global at 0x006f9590, which the class registration fills with "Cam".

Returns
The class key.
Ghidra address:
NTSC-U/C: 0x004b23d0
Ghidra address:
PAL: 0x004f05f8

Implements Rnd::Object.

◆ DumpText()

virtual void Rnd::Cam::DumpText ( Dbg & sink)
virtual

Write a description of this camera to sink.

The three base descriptions come first. The near plane, the far plane, the field of view, the screen rectangle, the depth range, and the render target name follow at any positive dump level, and the vertical ratio, the local and world projections, both frustums, and the inverse world projection only from level two. A camera with no render target writes "no object" in place of the target's quoted name.

Parameters
sinkThe diagnostic sink to write to.
Ghidra address:
NTSC-U/C: 0x004ad980
Ghidra address:
PAL: 0x004ebb40

Reimplemented from Rnd::Drawable.

◆ Replace()

virtual void Rnd::Cam::Replace ( Object * pFrom,
Object * pTo )
virtual

Repoint the render target when the object it addressed is replaced.

The three base implementations run first. A replacement is cast to Rnd::Tex. A replacement that is not a texture therefore clears the render target rather than storing a pointer of the wrong type.

Parameters
pFromThe object going away.
pToThe object to store instead, or null.
Ghidra address:
NTSC-U/C: 0x004b2608
Ghidra address:
PAL: 0x004f0830

Reimplemented from Rnd::Drawable.

◆ UpdateWorldXfm()

virtual int Rnd::Cam::UpdateWorldXfm ( Transformable * pParent,
int nForce )
virtual

Recompose the world transform and, when it changed, the world projection.

Rnd::Transformable vtable slot 2. The base routine reports whether it recomposed, and only then does UpdateWorldProject() run, which is what makes the projection follow the camera without rebuilding it every frame.

Parameters
pParentThe transform to compose against.
nForceNon-zero to recompose regardless of the dirty flag.
Returns
Non-zero when the world transform was recomposed.
Ghidra address:
NTSC-U/C: 0x004b1fa0
Ghidra address:
PAL: 0x004f01c8

Reimplemented from Rnd::Transformable.

◆ Save()

virtual void Rnd::Cam::Save ( Stream & stream)
virtual

Write this camera's serialised form to stream.

The three base forms follow the revision word in the order Transformable, Drawable, Collideable, which is not the order the bases are declared in.

Parameters
streamThe stream to write to.
Ghidra address:
NTSC-U/C: 0x004ae630
Ghidra address:
PAL: 0x004ec7f0

Reimplemented from Rnd::Drawable.

◆ Copy()

virtual void Rnd::Cam::Copy ( const Object * pSource,
unsigned nFlags )
virtual

Copy the state of pSource into this camera.

The render target is transferred with its reference, and the projection is rebuilt from the copied parameters rather than copied.

Parameters
pSourceThe camera to copy from.
nFlagsThe set of fields to copy.
Ghidra address:
NTSC-U/C: 0x004b24f8
Ghidra address:
PAL: 0x004f0720

Reimplemented from Rnd::Drawable.

◆ Load()

virtual void Rnd::Cam::Load ( Stream & stream)
virtual

Read this camera's serialised form from stream.

A revision above 8 is rejected with "Can't load new Cam". Three revision-gated words are read and discarded, which is how the reader steps over fields the format has dropped. The depth range arrives from revision 4, the render target from revision 5, and the Collideable form from revision 8.

Parameters
streamThe stream to read from.
Ghidra address:
NTSC-U/C: 0x004ae870
Ghidra address:
PAL: 0x004eca30

Reimplemented from Rnd::Drawable.

◆ NewCam()

Cam * Rnd::Cam::NewCam ( const HxStr & name)
static

Build a camera the class registry vends.

Parameters
nameThe registry key for the new camera.
Returns
The new camera.
Ghidra address:
NTSC-U/C: 0x004b2470
Ghidra address:
PAL: 0x004f0698

◆ FindCollisions()

virtual void Rnd::Cam::FindCollisions ( const Vector2 & point,
std::list< Collision > & collisions )
protectedvirtual

Report whether a screen point lies inside the screen rectangle.

Vtable slot 2 of the Rnd::Collideable table. A showing camera whose rectangle strictly encloses the point appends itself at distance zero. The Rnd::Collideable query runs afterwards either way.

Parameters
pointThe screen point.
collisionsThe list to append an intersection to.
Ghidra address:
NTSC-U/C: 0x004ad820
Ghidra address:
PAL: 0x004eb9e0

Reimplemented from Rnd::Collideable.

◆ DrawShowing()

virtual int Rnd::Cam::DrawShowing ( )
protectedvirtual

Make this camera the one the frame is drawn through.

Vtable slot 3 of the Rnd::Drawable table. Rnd::PsCam overrides it with the routine that also submits the display registers.

Returns
Non-zero, which draws the children as well.
Ghidra address:
NTSC-U/C: 0x004b1fe0
Ghidra address:
PAL: 0x004f0208

Reimplemented from Rnd::Drawable.

Reimplemented in Rnd::PsCam.

Member Data Documentation

◆ sCurrent

Cam* Rnd::Cam::sCurrent
static

Camera the frame is being drawn through.

Rnd::Cam::DrawShowing() stores itself here, the destructor clears it when it addresses the camera going away, and Rnd::PsCam::DrawShowing() stores its own camera the same way.

Ghidra address:
NTSC-U/C: 0x006f9588
Ghidra address:
PAL: 0x0073cfd8

◆ sNew

Cam *(* Rnd::Cam::sNew) (const HxStr &name)
static

Creator the registered "Cam" class builds through.

Starts as Cam::NewCam(). Rnd::PsCam::Init() installs Rnd::PsCam::NewCam(), and a camera loaded from a file on the PlayStation 2 is therefore a Rnd::PsCam.

Ghidra address:
NTSC-U/C: 0x006f958c
Ghidra address:
PAL: 0x0073cfdc

◆ sClassName

HxStr Rnd::Cam::sClassName
static

Registered class name of Rnd::Cam, the string "Cam".

Ghidra address:
NTSC-U/C: 0x006f9590
Ghidra address:
PAL: 0x0073cfe0

◆ mWorldToCam

Vector3 Rnd::Cam::mWorldToCam[kXfmRowCount]

Inverse of the world transform, which maps world space into camera space.

Rnd::Mesh::PrepareDraw() reads the second component of the translation row to obtain the depth of a bounding sphere, which is what proves the routine that fills it is an inverse rather than a transpose. +0xe0

◆ mLocalProject

Vector3 Rnd::Cam::mLocalProject[kXfmRowCount]

Projection from camera space onto the screen rectangle.

+0x120

◆ mWorldProject

Vector3 Rnd::Cam::mWorldProject[kXfmRowCount]

mWorldToCam followed by mLocalProject.

+0x1a0

◆ mInvWorldProject

Vector3 Rnd::Cam::mInvWorldProject[kXfmRowCount]

mInvLocalProject followed by the world transform.

+0x1e0

◆ mLocalFrustum

Frustum Rnd::Cam::mLocalFrustum
protected

◆ mWorldFrustum

Frustum Rnd::Cam::mWorldFrustum

The view volume in world space.

Rnd::Mesh::PrepareDraw() tests a bounding sphere against these planes. They are not the same planes as Rnd::g_drawFrustum, which a separate test uses. +0x280

◆ mNearPlane

float Rnd::Cam::mNearPlane
protected

◆ mFarPlane

float Rnd::Cam::mFarPlane
protected

◆ mFov

float Rnd::Cam::mFov
protected

◆ mYRatio

float Rnd::Cam::mYRatio
protected

◆ mZRange

Vector2 Rnd::Cam::mZRange
protected

◆ mScreenRect

Rect Rnd::Cam::mScreenRect

Fraction of the render target the projected image is placed in.

Rnd::Mesh::PrepareDraw() reads the width to scale its projected size estimate. +0x2f8

◆ mpTargetTex

Tex* Rnd::Cam::mpTargetTex

Texture this camera draws into, or null to draw into the frame buffer.

Rnd::PsMesh::DrawShowing() tests it and suppresses its depth register writes while it is set, which is what makes a camera with a render target skip them. +0x308


The documentation for this class was generated from the following file: