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

Root of a loadable scene. More...

#include <view.h>

Inheritance diagram for Rnd::View:
Collaboration diagram for Rnd::View:

Public Member Functions

void * operator new (size_t nSize)
 Allocate a view from the tagged heap under the tag "Rnd::View".
void operator delete (void *pBlock)
 Release a view to the tagged heap.
 View (const HxStr &name)
 Construct an empty scene root.
virtual ~View ()
virtual void DumpText (Dbg &sink)
virtual void Save (Stream &stream)
virtual void Replace (Object *pFrom, Object *pTo)
virtual const HxStr & ClassName () const
virtual void Copy (const Object *pSource, unsigned nFlags)
virtual void Load (Stream &stream)
void AddView (View *pChild)
 Add another view as a child in all three roles.
void RemoveView (View *pChild)
 Remove another view from all four child roles.
Public Member Functions inherited from Rnd::Animatable
 Animatable ()
 Construct an animatable with no children, no filters, and a zero frame.
virtual ~Animatable ()
 Drop this object's references on its children and delete its filters.
Animatable * Parent ()
 Report the animatable that animates this one.
void AddAnim (Animatable *pAnim)
 Append pAnim to mAnims.
void RemoveAnim (Animatable *pAnim)
 Erase pAnim from mAnims.
void SetFrame (float flFrame)
 Drive this object and its whole subtree to a frame.
float UnfilterFrame (float flValue)
 Map a value back through mFilters.
void AddFilter (Filter *pFilter)
 Append an already-built filter to mFilters.
void AddScaleOffset (float flScale, float flOffset)
 Append a new ScaleOffset stage to mFilters.
void AddMinMaxLoop (float flMin, float flMax, int nLoop)
 Append a new MinMaxLoop stage to mFilters.
void AddZeroOrder (float flLevel, float flMaxDelta)
 Append a new ZeroOrder stage to mFilters.
void AddFirstOrder (float flLevel, float flRatio)
 Append a new FirstOrder stage to mFilters.
void AddSecondOrder (float flLevel, float flSpring, float flDamper)
 Append a new SecondOrder stage to mFilters.
void RemoveFilter (int nIndex)
 Delete and erase the filter at one position in mFilters.
Filter * FilterAt (int nIndex)
 Return the filter at one position in mFilters.
void SetRate (float flRate)
 Change the multiplier of the ScaleOffset stage at the front of mFilters.
void SetOffset (float flOffset)
 Change the addend of the ScaleOffset stage at the front of mFilters.
void SetLoopRange (float flMin, float flMax)
 Change both ends of the MinMaxLoop stage at the back of mFilters.
virtual float FilteredFrameEnd ()
 Report the last frame this object's subtree animates to.
virtual void StartAnim ()
 Restart the animation of this object and its whole subtree.
void RemoveAllAnims ()
 Drop this object's reference on every mAnims entry and then empty mAnims.
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::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::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.
virtual int UpdateWorldXfm (Transformable *pParent, int nForce)
 Compose mWorldXfm from mLocalXfm and the parent's world transform.
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.
virtual void FindCollisions (const Vector2 &point, std::list< Collision > &collisions)
 Test a screen point against this object and append what it strikes to collisions.

Static Public Member Functions

static View * NewView (const HxStr &name)
 Build a view the class registry vends.
static void Init ()
 Register the five class keys this class answers to with Rnd::TheManager.
Static Public Member Functions inherited from Rnd::Animatable
static Filter * NewFilter (int nType)
 Build one default-constructed filter for a type tag.
Static Public Member Functions inherited from Rnd::Drawable
static Drawable * Find (const HxStr &name)
 Resolve a registry key to a drawable.

Public Attributes

int mAnimatable
int mTransformable
int mDrawable
int mCollideable
Public Attributes inherited from Rnd::Animatable
float mFilteredFrame
 The frame SetFrame() last received, after the filter chain.
Public Attributes inherited from Rnd::Object
HxStr mName
int mInternal
Public Attributes inherited from Rnd::Drawable
int mShowing
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.

Additional Inherited Members

Public Types inherited from Rnd::Animatable
enum  FilterType {
  kFilterScaleOffset = 0 , kFilterMinMaxLoop = 1 , kFilterZeroOrder = 2 , kFilterFirstOrder = 3 ,
  kFilterSecondOrder = 4
}
 Value a filter reports from Filter::Type() and a .rnd file stores in front of its payload. More...
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...
Protected Member Functions inherited from Rnd::Animatable
virtual void SetFrameSelf (float flFrame)
 Animate this object alone to a frame.
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::Drawable
virtual int DrawShowing ()
 Draw this object alone.
void ReleaseDrawsRefs ()
 Drop this object's reference on every mDraws entry without emptying the list.
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 inherited from Rnd::Object
std::list< Object * > mRefs
Protected Attributes inherited from Rnd::Transformable
float mOrigin [kXfmRowFloatCount]
int mBillboard

Detailed Description

Root of a loadable scene.

Its RTTI descriptor is at 0x008ef120. The descriptor lists four public non-virtual bases and fixes their subobject offsets, Rnd::Animatable at +0x00, Rnd::Drawable at +0x18, Rnd::Transformable at +0x30, and Rnd::Collideable at +0xe0. The shared Rnd::Object virtual base sits at +0x100, and the constructor writes that address into the virtual-base pointer of all four subobjects. View's own four fields occupy +0xf0 through +0xff and start zeroed.

Five vtables belong to the class, one per subobject plus the one the Rnd::Object subobject vptr addresses. They are 0x00823628 (Animatable), 0x00823600 (Drawable), 0x008235e0 (Transformable), 0x008235c0 (Collideable), and 0x00823650 (Object). Every entry of the last four adjusts this back to the start of the View. The Drawable table repeats the base implementations of SetShowing, SetHighlight, and DrawShowing, so View overrides none of the three and draws nothing of its own.

A .rnd file exposes its scene root under the name "view", which start-up resolves through Rnd::Manager::Find().

Five class keys resolve to this one class, which is what the four flags below record. Init() registers "View" against a factory that sets no flag, and "Animatable", "Collideable", "Drawable", and "Transformable" against four factories that each set one. A file naming a bare mix-in therefore loads a View that remembers which mix-in was asked for.

The destructor follows the engine pattern of dropping this object's own references and then ReleaseAllRefs(). A view holds no reference of its own, so the first step is an empty body.

Constructor & Destructor Documentation

◆ View()

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

Construct an empty scene root.

The four flags below start zeroed, and each of the four base subobjects is constructed against the one shared Rnd::Object subobject at +0x100.

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

◆ ~View()

virtual Rnd::View::~View ( )
virtual
Ghidra address:
NTSC-U/C: 0x004e21b8
Ghidra address:
PAL: 0x00520a70

Member Function Documentation

◆ operator new()

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

Allocate a view from the tagged heap under the tag "Rnd::View".

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

◆ operator delete()

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

Release a view to the tagged heap.

Parameters
pBlockThe block.
Ghidra address:
NTSC-U/C: 0x004e2068
Ghidra address:
PAL: 0x00520920

◆ DumpText()

virtual void Rnd::View::DumpText ( Dbg & sink)
virtual
Ghidra address:
NTSC-U/C: 0x004e3768
Ghidra address:
PAL: 0x00522020

Reimplemented from Rnd::Animatable.

◆ Save()

virtual void Rnd::View::Save ( Stream & stream)
virtual
Ghidra address:
NTSC-U/C: 0x004e37d0
Ghidra address:
PAL: 0x00522088

Reimplemented from Rnd::Animatable.

◆ Replace()

virtual void Rnd::View::Replace ( Object * pFrom,
Object * pTo )
virtual
Ghidra address:
NTSC-U/C: 0x004e36f8
Ghidra address:
PAL: 0x00521fb0

Reimplemented from Rnd::Animatable.

◆ ClassName()

virtual const HxStr & Rnd::View::ClassName ( ) const
virtual
Ghidra address:
NTSC-U/C: 0x004e2720
Ghidra address:
PAL: 0x00520fd8

Implements Rnd::Object.

◆ Copy()

virtual void Rnd::View::Copy ( const Object * pSource,
unsigned nFlags )
virtual
Ghidra address:
NTSC-U/C: 0x004e3850
Ghidra address:
PAL: 0x00522108

Reimplemented from Rnd::Animatable.

◆ Load()

virtual void Rnd::View::Load ( Stream & stream)
virtual
Ghidra address:
NTSC-U/C: 0x004e0128
Ghidra address:
PAL: 0x0051e978

Reimplemented from Rnd::Animatable.

◆ NewView()

View * Rnd::View::NewView ( const HxStr & name)
static

Build a view the class registry vends.

Parameters
nameThe registry key for the new view.
Returns
The new view.
Ghidra address:
NTSC-U/C: 0x004e2088
Ghidra address:
PAL: 0x00520940

◆ Init()

void Rnd::View::Init ( )
static

Register the five class keys this class answers to with Rnd::TheManager.

The four mix-in keys are registered from temporary strings the routine builds from literals, and only the "View" key uses a string global.

Ghidra address:
NTSC-U/C: 0x004dff48
Ghidra address:
PAL: 0x0051e720

◆ AddView()

void Rnd::View::AddView ( View * pChild)

Add another view as a child in all three roles.

Appends it to the draw list and adds it to the animation and transform lists. The body is defined in the unit of the tunnel object cache, and Overlay's constructor is the one caller. The title is inferred.

Parameters
pChildThe view to add.
Ghidra address:
NTSC-U/C: 0x0040f660
Ghidra address:
PAL: 0x004490e8

◆ RemoveView()

void Rnd::View::RemoveView ( View * pChild)

Remove another view from all four child roles.

Removes it from the draw, animation, transform, and collision lists. The body is defined in the unit of the tunnel object cache, and Overlay's constructor is the one caller. The title is inferred.

Parameters
pChildThe view to remove.
Ghidra address:
NTSC-U/C: 0x0040f5f8
Ghidra address:
PAL: 0x00449080

Member Data Documentation

◆ mAnimatable

int Rnd::View::mAnimatable

Set when the class key was "Animatable". +0xf0

◆ mTransformable

int Rnd::View::mTransformable

Set when the class key was "Transformable". +0xf4

◆ mDrawable

int Rnd::View::mDrawable

Set when the class key was "Drawable". +0xf8

◆ mCollideable

int Rnd::View::mCollideable

Set when the class key was "Collideable". +0xfc


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