wavelength 1.0.0
Loading...
Searching...
No Matches
RndAnimatable Class Reference

Mix-in for an object driven by a frame. More...

#include <rndanimatable.h>

Inheritance diagram for RndAnimatable:
Collaboration diagram for RndAnimatable:

Classes

class  Filter
 One stage of the frame filter chain. More...
class  ScaleOffset
 Stage that scales the frame and adds an offset. More...
class  MinMaxLoop
 Stage that clamps the frame to a range, or wraps it around the range. More...
class  ZeroOrder
 Stage that follows the frame by at most a fixed step a call. More...
class  FirstOrder
 Stage that moves the level toward the frame by a fixed ratio of the gap. More...
class  SecondOrder
 Stage that follows the frame like a damped spring. More...

Public Types

enum  FilterType {
  kFilterScaleOffset = 0 , kFilterMinMaxLoop = 1 , kFilterZeroOrder = 2 , kFilterFirstOrder = 3 ,
  kFilterSecondOrder = 4
}
 The type tags of the filters, as Save() writes them. More...

Public Member Functions

 RndAnimatable ()
 Construct an animatable at frame 0 without children or filters.
 ~RndAnimatable () override
 Drop the references on the children and delete the filters.
virtual float EndFrame ()
 Report the frame at which the animation ends.
virtual void ListAnimObjects (std::list< RndObject * > &objects)
 Add the objects the animation uses to a list.
virtual int SetFrameSelf (float fFrame)
 Apply a filtered frame to this object alone.
void DumpText (PrnStream &stream) override
 Write a description of the animatable.
void Save (BinStream &stream) override
 Write the filters and the names of the children.
void Replace (RndObject *pFrom, RndObject *pTo) override
 Replace a child with another object.
void Copy (const RndObject *pSource, int nFlags) override
 Copy the filters, and the children when the flags request them.
void Load (BinStream &stream) override
 Read what Save() wrote.
RndAnimatable * Parent ()
 Find the animatable whose children include this one.
void SetFrame (float fFrame)
 Filter a frame, apply it, and pass the result on to the children.
float FilterFrame (float fValue)
 Run a frame through the filters.
float UnfilterFrame (float fValue)
 Run a filtered frame back through the filters, last first.
float ChildrenEndFrame ()
 Report the latest end frame of the children, unfiltered through this animatable.
bool AddAnim (RndAnimatable *pAnim)
 Append a child.
void RemoveAnim (RndAnimatable *pAnim)
 Remove a child.
void RemoveAllAnims ()
 Remove every child.
const std::list< Filter * > & GetFilters () const
float GetFrame () const
float GetFilteredFrame () const
const std::list< RndAnimatable * > & GetAnims () const
std::list< Filter * > & GetFilters ()
Public Member Functions inherited from RndObject
 RndObject (const char *pszName)
 Construct an object and register it under a name.
virtual ~RndObject ()
 Notify every referrer, then erase the registration.
virtual const char * ClassName () const =0
 Report the name of the object's most derived class.
void SetName (const char *pszName)
 Register the object under a different name.
void AddRef (RndObject *pReferrer)
 Register an object as a store of a pointer to this one.
void RemoveRef (RndObject *pReferrer)
 Drop the first registration AddRef() made for a referrer.
const char * GetName () const
const std::list< RndObject * > & GetRefs () const
int GetInternal () const
void SetInternal (int nInternal)

Static Public Member Functions

static Filter * NewFilter (int nType)
 Create a filter stage of a type, with its parameters unset.
static void CollectChildren (std::list< RndObject * > &objects, RndAnimatable *pAnimatable)
 Append every animation descendant of an animatable, depth first, each before its descendants.

Static Public Attributes

static int sRev
 The format version Save() writes and Load() accepts.
Static Public Attributes inherited from RndObject
static constexpr int kCopyChildLists = 0x200
 The bit of the Copy() flags that copies the child lists of the mix-ins.

Protected Member Functions

void ReleaseObjects ()
 Drop the references on the children without emptying the list, and delete the filters.
void AcquireAnimRefs ()
 Take a reference on every child.

Protected Attributes

std::list< RndAnimatable * > mAnims
std::list< Filter * > mFilters
float mFrame
float mFilteredFrame
Protected Attributes inherited from RndObject
std::list< RndObject * > mRefs
String mName

Detailed Description

Mix-in for an object driven by a frame.

It filters the frame and passes it on to a list of other animatables.

The RTTI includes the class name and records RndObject as a virtual base. Every entry of mAnims registers this object as a referrer through RndObject::AddRef(). The filters are owned outright.

Member Enumeration Documentation

◆ FilterType

The type tags of the filters, as Save() writes them.

Enumerator
kFilterScaleOffset 

ScaleOffset.

kFilterMinMaxLoop 

MinMaxLoop.

kFilterZeroOrder 

ZeroOrder.

kFilterFirstOrder 

FirstOrder.

kFilterSecondOrder 

SecondOrder.

Constructor & Destructor Documentation

◆ RndAnimatable()

RndAnimatable::RndAnimatable ( )
inline

Construct an animatable at frame 0 without children or filters.

The constructor has no out-of-line copy.

◆ ~RndAnimatable()

RndAnimatable::~RndAnimatable ( )
override

Drop the references on the children and delete the filters.

Ghidra address:
NTSC-U/C: 0x0037ed08
Ghidra address:
PAL: 0x003ed420

Member Function Documentation

◆ EndFrame()

virtual float RndAnimatable::EndFrame ( )
virtual

Report the frame at which the animation ends.

The base reports the latest end of the children, each taken back through its filters.

Returns
The frame.
Ghidra address:
NTSC-U/C: 0x0021b728
Ghidra address:
PAL: 0x00224540

Reimplemented in PsMovie, RndCursor, RndLightAnim, RndMatAnim, RndMeshAnim, RndParticleSysAnim, and RndTransAnim.

◆ ListAnimObjects()

virtual void RndAnimatable::ListAnimObjects ( std::list< RndObject * > & objects)
virtual

Add the objects the animation uses to a list.

The base body adds the objects of the children. The name is inferred.

Parameters
objectsThe list to add to.
Ghidra address:
NTSC-U/C: 0x0021b6a0
Ghidra address:
PAL: 0x002244b8

Reimplemented in RndLightAnim, RndMatAnim, RndMeshAnim, RndMovie, RndParticleSysAnim, and RndTransAnim.

◆ SetFrameSelf()

virtual int RndAnimatable::SetFrameSelf ( float fFrame)
inlinevirtual

Apply a filtered frame to this object alone.

The base body does nothing. The name is inferred.

Parameters
fFrameThe filtered frame.
Returns
Non-zero when the children are to receive the frame as well.
Ghidra address:
NTSC-U/C: 0x0037e758
Ghidra address:
PAL: 0x003ece88

Reimplemented in PsMovie, RndArena, RndGenerator, RndLightAnim, RndMatAnim, RndMeshAnim, RndParticleSys, RndParticleSysAnim, RndTransAnim, and RndView.

◆ DumpText()

void RndAnimatable::DumpText ( PrnStream & stream)
overridevirtual

Write a description of the animatable.

Nothing is written unless the dump level of the stream is above 0.

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

Reimplemented from RndObject.

Reimplemented in RndArena, RndCursor, RndGenerator, RndLightAnim, RndMatAnim, RndMeshAnim, RndMovie, RndParticleSys, RndParticleSysAnim, RndTransAnim, and RndView.

◆ Save()

void RndAnimatable::Save ( BinStream & stream)
overridevirtual

Write the filters and the names of the children.

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

Implements RndObject.

Reimplemented in RndArena, RndCursor, RndGenerator, RndLightAnim, RndMatAnim, RndMeshAnim, RndMovie, RndParticleSys, RndParticleSysAnim, RndTransAnim, and RndView.

◆ Replace()

void RndAnimatable::Replace ( RndObject * pFrom,
RndObject * pTo )
overridevirtual

Replace a child with another object.

A replacement that is not an animatable, or null, removes the child.

Parameters
pFromThe object being replaced.
pToThe replacement, or null.
Ghidra address:
NTSC-U/C: 0x0021c4d0
Ghidra address:
PAL: 0x002252e8

Implements RndObject.

Reimplemented in RndArena, RndCursor, RndGenerator, RndLightAnim, RndMatAnim, RndMeshAnim, RndMovie, RndParticleSys, RndParticleSysAnim, RndTransAnim, and RndView.

◆ Copy()

void RndAnimatable::Copy ( const RndObject * pSource,
int nFlags )
overridevirtual

Copy the filters, and the children when the flags request them.

Parameters
pSourceThe animatable to copy from.
nFlagsThe set of fields to copy. RndObject::kCopyChildLists copies the children.
Ghidra address:
NTSC-U/C: 0x0021bd00
Ghidra address:
PAL: 0x00224b18

Implements RndObject.

Reimplemented in RndArena, RndCursor, RndGenerator, RndLightAnim, RndMatAnim, RndMeshAnim, RndMovie, RndParticleSys, RndParticleSysAnim, RndTransAnim, and RndView.

◆ Load()

void RndAnimatable::Load ( BinStream & stream)
overridevirtual

Read what Save() wrote.

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

Implements RndObject.

Reimplemented in RndArena, RndCursor, RndGenerator, RndLightAnim, RndMatAnim, RndMeshAnim, RndMovie, RndParticleSys, RndParticleSysAnim, RndTransAnim, and RndView.

◆ Parent()

RndAnimatable * RndAnimatable::Parent ( )

Find the animatable whose children include this one.

Returns
The parent, or null.
Ghidra address:
NTSC-U/C: 0x0021b5d8
Ghidra address:
PAL: 0x002243f0

◆ SetFrame()

void RndAnimatable::SetFrame ( float fFrame)

Filter a frame, apply it, and pass the result on to the children.

Parameters
fFrameThe frame.
Ghidra address:
NTSC-U/C: 0x0021b7e8
Ghidra address:
PAL: 0x00224600

◆ FilterFrame()

float RndAnimatable::FilterFrame ( float fValue)

Run a frame through the filters.

Parameters
fValueThe frame.
Returns
The filtered frame.
Ghidra address:
NTSC-U/C: 0x0021be90
Ghidra address:
PAL: 0x00224ca8

◆ UnfilterFrame()

float RndAnimatable::UnfilterFrame ( float fValue)

Run a filtered frame back through the filters, last first.

Parameters
fValueThe filtered frame.
Returns
The frame.
Ghidra address:
NTSC-U/C: 0x0021bf10
Ghidra address:
PAL: 0x00224d28

◆ ChildrenEndFrame()

float RndAnimatable::ChildrenEndFrame ( )

Report the latest end frame of the children, unfiltered through this animatable.

Each child's EndFrame() is unfiltered through the child's filters first. Without children the result is UnfilterFrame(0).

Returns
The end frame.
Ghidra address:
NTSC-U/C: 0x00199c10
Ghidra address:
PAL: 0x001a1150

◆ AddAnim()

bool RndAnimatable::AddAnim ( RndAnimatable * pAnim)

Append a child.

An animatable already among the children is not added again.

Parameters
pAnimThe new child.
Returns
Whether the child was added.
Ghidra address:
NTSC-U/C: 0x0021c688
Ghidra address:
PAL: 0x002254a0

◆ RemoveAnim()

void RndAnimatable::RemoveAnim ( RndAnimatable * pAnim)

Remove a child.

Parameters
pAnimThe child.
Ghidra address:
NTSC-U/C: 0x0021c780
Ghidra address:
PAL: 0x00225598

◆ RemoveAllAnims()

void RndAnimatable::RemoveAllAnims ( )

Remove every child.

Ghidra address:
NTSC-U/C: 0x0021c850
Ghidra address:
PAL: 0x00225668

◆ NewFilter()

Filter * RndAnimatable::NewFilter ( int nType)
static

Create a filter stage of a type, with its parameters unset.

An unknown type warns and yields null.

Parameters
nTypeThe FilterType.
Returns
The stage, or null.
Ghidra address:
NTSC-U/C: 0x0021bfc8
Ghidra address:
PAL: 0x00224de0

◆ CollectChildren()

void RndAnimatable::CollectChildren ( std::list< RndObject * > & objects,
RndAnimatable * pAnimatable )
inlinestatic

Append every animation descendant of an animatable, depth first, each before its descendants.

Each unit that uses the inline routine emits a copy. The first address is the copy of RndManager, and the second the copy of UIList.

Parameters
objectsThe list to append to.
pAnimatableThe animatable to start from, or null.
Ghidra address:
NTSC-U/C: 0x00237eb0
Ghidra address:
PAL: 0x00240a30
Ghidra address:
NTSC-U/C: 0x00205430
Ghidra address:
PAL: 0x0020e1e8

◆ GetFilters() [1/2]

const std::list< Filter * > & RndAnimatable::GetFilters ( ) const
inline
Returns
The filter chain, applied first to last.

◆ GetFrame()

float RndAnimatable::GetFrame ( ) const
inline
Returns
The frame SetFrame() last received.

◆ GetFilteredFrame()

float RndAnimatable::GetFilteredFrame ( ) const
inline
Returns
The frame after the filters.

◆ GetAnims()

const std::list< RndAnimatable * > & RndAnimatable::GetAnims ( ) const
inline
Returns
The children. Each receives the filtered frame.

◆ GetFilters() [2/2]

std::list< Filter * > & RndAnimatable::GetFilters ( )
inline
Returns
The filter chain, applied first to last, for writing.

◆ ReleaseObjects()

void RndAnimatable::ReleaseObjects ( )
protected

Drop the references on the children without emptying the list, and delete the filters.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x0021bb20
Ghidra address:
PAL: 0x00224938

◆ AcquireAnimRefs()

void RndAnimatable::AcquireAnimRefs ( )
protected

Take a reference on every child.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x0021bbf0
Ghidra address:
PAL: 0x00224a08

Member Data Documentation

◆ sRev

int RndAnimatable::sRev
static

The format version Save() writes and Load() accepts.

Ghidra address:
NTSC-U/C: 0x003b07f0
Ghidra address:
PAL: 0x0042f688

◆ mAnims

std::list<RndAnimatable *> RndAnimatable::mAnims
protected

The children. Each receives the filtered frame.

◆ mFilters

std::list<Filter *> RndAnimatable::mFilters
protected

The filter chain, applied first to last.

◆ mFrame

float RndAnimatable::mFrame
protected

The frame SetFrame() last received.

◆ mFilteredFrame

float RndAnimatable::mFilteredFrame
protected

The frame after the filters.


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