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

Emitter that spawns copies of one drawable along an animated path. More...

#include <generator.h>

Inheritance diagram for Rnd::Generator:
Collaboration diagram for Rnd::Generator:

Classes

struct  Instance
 One live instance. More...

Public Member Functions

 Generator (const HxStr &name)
 Construct an emitter with no instances and no subject.
virtual ~Generator ()
virtual void DumpText (Dbg &sink)
 Write the emitter to the engine text sink.
virtual void Save (Stream &stream)
 Write revision 7 of the emitter to stream.
virtual void Replace (Object *pFrom, Object *pTo)
 Replace one object reference with another.
virtual const HxStr & ClassName () const
 Return the registered class name, "Generator".
virtual void Copy (const Object *pSource, unsigned nFlags)
 Copy another emitter over this one.
virtual void Load (Stream &stream)
 Read the emitter from stream.
void Regenerate ()
 Give every live instance a fresh particle from mParticleSys.
std::list< Instance > & Instances ()
 Report the live instance list.
int NumInstances ()
 Count the live instances.
void SetMesh (Mesh *pMesh)
 Make a mesh the drawn subject.
void SetView (View *pView)
 Make a view the drawn subject, clearing mMesh, mMultiMesh, and mParticleSys.
void SetMultiMesh (MultiMesh *pMultiMesh)
 Make a multi-mesh the drawn subject, clearing mMesh, mView, and mParticleSys.
void SetParticleSys (ParticleSys *pParticleSys)
 Make a particle system the drawn subject, clearing mMesh, mView, and mMultiMesh.
void SetBirthCamera (Cam *pCam)
 Set the camera the birth culling measures against.
void SetPath (TransAnim *pPath, float flStartFrame, float flEndFrame)
 Replace the path and set the frame span the instances travel.
TransAnim * GetPath () const
 Report the path.
float GetPathStartFrame () const
 Report the path frame an instance starts at.
float GetPathEndFrame () const
 Report the path frame an instance ends at.
Mesh * GetMesh () const
 Report the mesh subject.
View * GetView () const
 Report the view subject.
MultiMesh * GetMultiMesh () const
 Report the multi-mesh subject.
ParticleSys * GetParticleSys () const
 Report the particle system subject.
void SetAnimateFromStart (int nAnimateFromStart)
 Set mAnimateFromStart.
int GetAnimateFromStart () const
 Report mAnimateFromStart.
void SetBirthFrontOnly (int nBirthFrontOnly)
 Set mBirthFrontOnly.
int GetBirthFrontOnly () const
 Report mBirthFrontOnly.
void SetBirthSquareDistCull (int nCull)
 Set mBirthSquareDistCull.
int GetBirthSquareDistCull () const
 Report mBirthSquareDistCull.
void SetBirthSquareDist (float flSquareDist)
 Set mBirthSquareDist.
float GetBirthSquareDist () const
 Report mBirthSquareDist.
Cam * GetBirthCam () const
 Report the birth camera.
void SetNextSpawnFrame (float flFrame)
 Set mNextSpawnFrame.
void SetRateGen (float flLow, float flHigh)
 Set the bounds of the random spawn interval.
void GetRateGen (float &flLow, float &flHigh) const
 Report the bounds of the random spawn interval.
void SetScaleGen (float flLow, float flHigh)
 Set the bounds of the random instance scale.
void GetScaleGen (float &flLow, float &flHigh) const
 Report the bounds of the random instance scale.
void SetPathVarMax (float flX, float flY, float flZ)
 Set the largest random rotation about each axis, in degrees.
void GetGenPathVarMax (float &flX, float &flY, float &flZ) const
 Report the largest random rotation about each axis, in degrees.
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::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::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.

Static Public Member Functions

static void Init ()
 Register the class with Rnd::TheManager under the key "Generator".
static void * operator new (size_t nSize)
 Allocate an emitter under the tag "Rnd::Generator".
static void operator delete (void *pBlock)
 Release an emitter under the tag "Rnd::Generator".
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

float mNextSpawnFrame
 Frame the next instance is spawned on.
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::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.
Public Attributes inherited from Rnd::Drawable
int mShowing

Protected Member Functions

virtual int DrawShowing ()
 Draw every live instance.
virtual void SetFrameSelf (float flFrame)
 Expire and spawn instances for 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::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::Drawable
void ReleaseDrawsRefs ()
 Drop this object's reference on every mDraws entry without emptying the list.

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 Attributes inherited from Rnd::Object
std::list< Object * > mRefs
Protected Attributes inherited from Rnd::Transformable
float mOrigin [kXfmRowFloatCount]
int mBillboard

Detailed Description

Emitter that spawns copies of one drawable along an animated path.

Its RTTI descriptor is at 0x008ef5e0, its name string at 0x0081c640, and its three base entries record Rnd::Animatable at +0x00, Rnd::Transformable at +0x20, and Rnd::Drawable at +0xd0, each non-virtual and public. All three derive virtually from Rnd::Object, so one shared Object subobject sits at +0x140, which the constructor proves by writing this + 0x140 into the virtual-base pointer of each of the three subobjects. The class is therefore 0x15c bytes, and the creator allocates 0x160, which is that size rounded up to the quadword the vector unit reads a transform from. The members of the class itself occupy +0xe4 through +0x13f.

The base offsets also pin the three base subobjects. Animatable uses 0x18 bytes, and the eight bytes after it are the padding that puts the 16-byte-aligned Transformable subobject on +0x20. Transformable uses 0xac and its size rounds to 0xb0 on its own 16-byte alignment, and Drawable uses 0x14. The last member, mMultiMeshCursor at +0x13c, ends exactly on the virtual base subobject, so the non-virtual part needs no padding.

Four vtables belong to the class, each identified by a GetTypeInfo slot addressing 0x0045db10 and by an adjustment matching its subobject offset. The Drawable table at 0x0081c508 adjusts by -0xd0 and overrides only DrawShowing(). The Transformable table at 0x0081c530 adjusts by -0x20 and overrides nothing. The Animatable table at 0x0081c550 has a zero adjustment and overrides only SetFrameSelf(). The Object subobject table at 0x0081c578 adjusts by -0x140 and stores the seven Object virtuals. Every table ends in an all-zero entry, which is the terminator rather than a null slot. No table gains a slot past the own count of its base. This class therefore declares no virtual of its own.

Every member title below comes from the text DumpText() writes, so each one is recovered rather than inferred: "path:", " mesh:", " birthFrontOnly:", "birthSquareDist:", " birthCam:", "rateGenLow:", " rateGenHigh:", "scaleGenLow:", " scaleGenHigh:", "pathVarMax:(", "view:", " animateFromStart:", "multiMesh:", " particleSys:", "instances:", "pathEndFrame:", and " pathStartFrame:". The names of the two members the dump omits but SetFrameSelf() uses follow what SetFrameSelf() does with them, and each one records that inference. The two the dump omits and no routine uses are named after their offsets.

The concrete type of each of the six object references comes from the narrowing cast Load() performs through the dynamic_cast helper at 0x005570e0, whose target type function identifies the class in every case.

SetFrameSelf() expires the instances whose age passed the path span, then spawns instances while the next spawn frame has not passed the current one, culling against mBirthCam and mBirthSquareDist first and giving each instance a random rotation drawn from mPathVarMax and a random uniform scale drawn from mScaleGenLow and mScaleGenHigh. DrawShowing() selects one of four draw paths from the table of pointers to member functions at 0x0081c448, DrawInstanceView(), DrawInstanceMesh(), DrawInstanceMultiMesh(), and DrawInstanceParticle(), preferring mView, then mMesh, then mMultiMesh, then mParticleSys.

The accessors between 0x0045dbb8 and 0x0045dca0 are inline, and each out-of-line copy has no callers.

Constructor & Destructor Documentation

◆ Generator()

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

Construct an emitter with no instances and no subject.

mAnimateFromStart starts at 1, the next spawn frame at the sentinel -9999999.0, both rateGen bounds at 100.0, both scaleGen bounds at 1.0, and every other member at zero.

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

◆ ~Generator()

virtual Rnd::Generator::~Generator ( )
virtual
Ghidra address:
NTSC-U/C: 0x0045de20
Ghidra address:
PAL: 0x0049b4c8

Member Function Documentation

◆ DumpText()

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

Write the emitter to the engine text sink.

The three base dumps run unconditionally and the block below them only while the dump level of the sink is positive. The instance list and the two path frames need level two.

Parameters
sinkThe text sink.
Ghidra address:
NTSC-U/C: 0x00459618
Ghidra address:
PAL: 0x00496ba0

Reimplemented from Rnd::Animatable.

◆ Save()

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

Write revision 7 of the emitter to stream.

The instance list is not written. A reloaded emitter starts empty, and Load() repopulates it through Regenerate().

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

Reimplemented from Rnd::Animatable.

◆ Replace()

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

Replace one object reference with another.

Parameters
pFromThe object being replaced.
pToThe object to point at, which may be null.
Ghidra address:
NTSC-U/C: 0x00459220
Ghidra address:
PAL: 0x004967a8

Reimplemented from Rnd::Animatable.

◆ ClassName()

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

Return the registered class name, "Generator".

Returns
The class name.
Ghidra address:
NTSC-U/C: 0x0045e2e8
Ghidra address:
PAL: 0x0049b990

Implements Rnd::Object.

◆ Copy()

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

Copy another emitter over this one.

The narrowing cast is not tested, so a source that is not an emitter is read through null.

Parameters
pSourceThe source object, which has to be an emitter.
nFlagsThe copy flags.
Ghidra address:
NTSC-U/C: 0x0045e3d8
Ghidra address:
PAL: 0x0049ba80

Reimplemented from Rnd::Animatable.

◆ Load()

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

Read the emitter from stream.

Rejects revision 8 and above, reporting "Can't load new Generator". Revision 7 is the only one this build writes, and every earlier revision is still read.

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

Reimplemented from Rnd::Animatable.

◆ Regenerate()

void Rnd::Generator::Regenerate ( )

Give every live instance a fresh particle from mParticleSys.

Does nothing while mParticleSys is null. Otherwise it releases every live particle, then allocates one particle per live instance and randomises the colour and the size of each one. Only the instance count is read. The loop never visits an instance, and an allocation that fails skips the randomisation at 0x0045aa0c and continues rather than ending the loop. mParticleCursor receives the allocation result whether or not it succeeded, because that store sits in the delay slot of the test.

Ghidra address:
NTSC-U/C: 0x0045a998
Ghidra address:
PAL: 0x00498008

◆ Instances()

std::list< Instance > & Rnd::Generator::Instances ( )

Report the live instance list.

The routine is two instructions that return the address of the member. It is compiled out of line here, so it exists as a function rather than as an accessor this reconstruction added.

Returns
The live instances.
Ghidra address:
NTSC-U/C: 0x0045e2f8
Ghidra address:
PAL: 0x0049b9a0

◆ Init()

void Rnd::Generator::Init ( )
static

Register the class with Rnd::TheManager under the key "Generator".

The class installs no creator hook, unlike Rnd::Blur and Rnd::Tex, so the thunk the registry stores calls the constructor directly.

Rnd::Manager::Init() also expands this inline.

Ghidra address:
NTSC-U/C: 0x0045dcc0
Ghidra address:
PAL: 0x0049b368

◆ operator new()

void * Rnd::Generator::operator new ( size_t nSize)
static

Allocate an emitter under the tag "Rnd::Generator".

Parameters
nSizeThe object size the compiler supplies.
Returns
The block.
Ghidra address:
NTSC-U/C: 0x0045db78
Ghidra address:
PAL: 0x0049b220

◆ operator delete()

void Rnd::Generator::operator delete ( void * pBlock)
static

Release an emitter under the tag "Rnd::Generator".

Parameters
pBlockThe block.
Ghidra address:
NTSC-U/C: 0x0045db98
Ghidra address:
PAL: 0x0049b240

◆ NumInstances()

int Rnd::Generator::NumInstances ( )

Count the live instances.

The image has no caller.

Returns
The length of the instance list.
Ghidra address:
NTSC-U/C: 0x0045e2a8
Ghidra address:
PAL: 0x0049b950

◆ SetMesh()

void Rnd::Generator::SetMesh ( Mesh * pMesh)

Make a mesh the drawn subject.

Releases the reference on the previous mesh, takes one on the new one, and clears mView, mMultiMesh, and mParticleSys, releasing each. The image has no caller, and the title is inferred.

Parameters
pMeshThe mesh, which may be null.
Ghidra address:
NTSC-U/C: 0x0045e698
Ghidra address:
PAL: 0x0049bd40

◆ SetView()

void Rnd::Generator::SetView ( View * pView)

Make a view the drawn subject, clearing mMesh, mMultiMesh, and mParticleSys.

The image has no caller, and the title is inferred.

Parameters
pViewThe view, which may be null.
Ghidra address:
NTSC-U/C: 0x0045e738
Ghidra address:
PAL: 0x0049bde0

◆ SetMultiMesh()

void Rnd::Generator::SetMultiMesh ( MultiMesh * pMultiMesh)

Make a multi-mesh the drawn subject, clearing mMesh, mView, and mParticleSys.

The image has no caller, and the title is inferred.

Parameters
pMultiMeshThe multi-mesh, which may be null.
Ghidra address:
NTSC-U/C: 0x0045e7d8
Ghidra address:
PAL: 0x0049be80

◆ SetParticleSys()

void Rnd::Generator::SetParticleSys ( ParticleSys * pParticleSys)

Make a particle system the drawn subject, clearing mMesh, mView, and mMultiMesh.

Calls Regenerate() afterwards. Every live instance then gains a particle. The image has no caller, and the title is inferred.

Parameters
pParticleSysThe particle system, which may be null.
Ghidra address:
NTSC-U/C: 0x0045e878
Ghidra address:
PAL: 0x0049bf20

◆ SetBirthCamera()

void Rnd::Generator::SetBirthCamera ( Cam * pCam)

Set the camera the birth culling measures against.

The image has no caller, and the title is inferred.

Parameters
pCamThe camera, which may be null.
Ghidra address:
NTSC-U/C: 0x0045ea18
Ghidra address:
PAL: 0x0049c0c0

◆ SetPath()

void Rnd::Generator::SetPath ( TransAnim * pPath,
float flStartFrame,
float flEndFrame )

Replace the path and set the frame span the instances travel.

Moves the reference from the previous path to the new one. A bound of -1 takes the matching end of the path's keyframe range, from TransAnim::StartFrame() or TransAnim::FilteredFrameEnd(), and any other value is stored as given. AppTunnel calls it.

Parameters
pPathThe path, or null.
flStartFrameThe path frame an instance starts at, or -1.
flEndFrameThe path frame an instance ends at, or -1.
Ghidra address:
NTSC-U/C: 0x0045e920
Ghidra address:
PAL: 0x0049bfc8

◆ GetPath()

TransAnim * Rnd::Generator::GetPath ( ) const
inline

Report the path.

Returns
The path, or null.
Ghidra address:
NTSC-U/C: 0x0045dbb8
Ghidra address:
PAL: 0x0049b260

◆ GetPathStartFrame()

float Rnd::Generator::GetPathStartFrame ( ) const
inline

Report the path frame an instance starts at.

Returns
The frame.
Ghidra address:
NTSC-U/C: 0x0045dbc0
Ghidra address:
PAL: 0x0049b268

◆ GetPathEndFrame()

float Rnd::Generator::GetPathEndFrame ( ) const
inline

Report the path frame an instance ends at.

Returns
The frame.
Ghidra address:
NTSC-U/C: 0x0045dbc8
Ghidra address:
PAL: 0x0049b270

◆ GetMesh()

Mesh * Rnd::Generator::GetMesh ( ) const
inline

Report the mesh subject.

Returns
The mesh, or null.
Ghidra address:
NTSC-U/C: 0x0045dbd0
Ghidra address:
PAL: 0x0049b278

◆ GetView()

View * Rnd::Generator::GetView ( ) const
inline

Report the view subject.

Returns
The view, or null.
Ghidra address:
NTSC-U/C: 0x0045dbd8
Ghidra address:
PAL: 0x0049b280

◆ GetMultiMesh()

MultiMesh * Rnd::Generator::GetMultiMesh ( ) const
inline

Report the multi-mesh subject.

Returns
The multi-mesh, or null.
Ghidra address:
NTSC-U/C: 0x0045dbe0
Ghidra address:
PAL: 0x0049b288

◆ GetParticleSys()

ParticleSys * Rnd::Generator::GetParticleSys ( ) const
inline

Report the particle system subject.

Returns
The particle system, or null.
Ghidra address:
NTSC-U/C: 0x0045dbe8
Ghidra address:
PAL: 0x0049b290

◆ SetAnimateFromStart()

void Rnd::Generator::SetAnimateFromStart ( int nAnimateFromStart)
inline

Set mAnimateFromStart.

Parameters
nAnimateFromStartNon-zero to drive mView to each instance's age.
Ghidra address:
NTSC-U/C: 0x0045dbf0
Ghidra address:
PAL: 0x0049b298

◆ GetAnimateFromStart()

int Rnd::Generator::GetAnimateFromStart ( ) const
inline

Report mAnimateFromStart.

Returns
Non-zero when mView is driven to each instance's age.
Ghidra address:
NTSC-U/C: 0x0045dbf8
Ghidra address:
PAL: 0x0049b2a0

◆ SetBirthFrontOnly()

void Rnd::Generator::SetBirthFrontOnly ( int nBirthFrontOnly)
inline

Set mBirthFrontOnly.

Parameters
nBirthFrontOnlyNon-zero to spawn only in front of mBirthCam.
Ghidra address:
NTSC-U/C: 0x0045dc00
Ghidra address:
PAL: 0x0049b2a8

◆ GetBirthFrontOnly()

int Rnd::Generator::GetBirthFrontOnly ( ) const
inline

Report mBirthFrontOnly.

Returns
Non-zero when instances spawn only in front of mBirthCam.
Ghidra address:
NTSC-U/C: 0x0045dc08
Ghidra address:
PAL: 0x0049b2b0

◆ SetBirthSquareDistCull()

void Rnd::Generator::SetBirthSquareDistCull ( int nCull)
inline

Set mBirthSquareDistCull.

Parameters
nCullNon-zero to apply the mBirthSquareDist cull.
Ghidra address:
NTSC-U/C: 0x0045dc10
Ghidra address:
PAL: 0x0049b2b8

◆ GetBirthSquareDistCull()

int Rnd::Generator::GetBirthSquareDistCull ( ) const
inline

Report mBirthSquareDistCull.

Returns
Non-zero when the mBirthSquareDist cull applies.
Ghidra address:
NTSC-U/C: 0x0045dc18
Ghidra address:
PAL: 0x0049b2c0

◆ SetBirthSquareDist()

void Rnd::Generator::SetBirthSquareDist ( float flSquareDist)
inline

Set mBirthSquareDist.

Parameters
flSquareDistThe squared distance from mBirthCam beyond which nothing spawns.
Ghidra address:
NTSC-U/C: 0x0045dc20
Ghidra address:
PAL: 0x0049b2c8

◆ GetBirthSquareDist()

float Rnd::Generator::GetBirthSquareDist ( ) const
inline

Report mBirthSquareDist.

Returns
The squared distance from mBirthCam beyond which nothing spawns.
Ghidra address:
NTSC-U/C: 0x0045dc28
Ghidra address:
PAL: 0x0049b2d0

◆ GetBirthCam()

Cam * Rnd::Generator::GetBirthCam ( ) const
inline

Report the birth camera.

Returns
The camera, or null.
Ghidra address:
NTSC-U/C: 0x0045dc30
Ghidra address:
PAL: 0x0049b2d8

◆ SetNextSpawnFrame()

void Rnd::Generator::SetNextSpawnFrame ( float flFrame)
inline

Set mNextSpawnFrame.

Parameters
flFrameThe frame the next instance spawns on.
Ghidra address:
NTSC-U/C: 0x0045dc38
Ghidra address:
PAL: 0x0049b2e0

◆ SetRateGen()

void Rnd::Generator::SetRateGen ( float flLow,
float flHigh )
inline

Set the bounds of the random spawn interval.

Parameters
flLowThe low bound.
flHighThe high bound.
Ghidra address:
NTSC-U/C: 0x0045dc40
Ghidra address:
PAL: 0x0049b2e8

◆ GetRateGen()

void Rnd::Generator::GetRateGen ( float & flLow,
float & flHigh ) const
inline

Report the bounds of the random spawn interval.

Parameters
flLowReceives the low bound.
flHighReceives the high bound.
Ghidra address:
NTSC-U/C: 0x0045dc50
Ghidra address:
PAL: 0x0049b2f8

◆ SetScaleGen()

void Rnd::Generator::SetScaleGen ( float flLow,
float flHigh )
inline

Set the bounds of the random instance scale.

Parameters
flLowThe low bound.
flHighThe high bound.
Ghidra address:
NTSC-U/C: 0x0045dc68
Ghidra address:
PAL: 0x0049b310

◆ GetScaleGen()

void Rnd::Generator::GetScaleGen ( float & flLow,
float & flHigh ) const
inline

Report the bounds of the random instance scale.

Parameters
flLowReceives the low bound.
flHighReceives the high bound.
Ghidra address:
NTSC-U/C: 0x0045dc78
Ghidra address:
PAL: 0x0049b320

◆ SetPathVarMax()

void Rnd::Generator::SetPathVarMax ( float flX,
float flY,
float flZ )
inline

Set the largest random rotation about each axis, in degrees.

Parameters
flXThe bound about x.
flYThe bound about y.
flZThe bound about z.
Ghidra address:
NTSC-U/C: 0x0045dc90
Ghidra address:
PAL: 0x0049b338

◆ GetGenPathVarMax()

void Rnd::Generator::GetGenPathVarMax ( float & flX,
float & flY,
float & flZ ) const
inline

Report the largest random rotation about each axis, in degrees.

Parameters
flXReceives the bound about x.
flYReceives the bound about y.
flZReceives the bound about z.
Ghidra address:
NTSC-U/C: 0x0045dca0
Ghidra address:
PAL: 0x0049b348

◆ DrawShowing()

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

Draw every live instance.

Rnd::Drawable vtable slot 3. Nothing is drawn without a path or a subject. Each instance is placed on the path at its age, scaled, and composed with its mXfmMod, then drawn through the selected path. A multi-mesh or particle system subject then draws once for all instances.

Returns
Non-zero when the children are to be drawn as well.
Ghidra address:
NTSC-U/C: 0x0045b040
Ghidra address:
PAL: 0x004986b0

Reimplemented from Rnd::Drawable.

◆ SetFrameSelf()

virtual void Rnd::Generator::SetFrameSelf ( float flFrame)
protectedvirtual

Expire and spawn instances for a frame.

Rnd::Animatable vtable slot 3. The first call only records the frame. A spawn that the birth camera culls ends the call, leaving later spawns for the next frame.

Parameters
flFrameThe filtered frame to animate to.
Ghidra address:
NTSC-U/C: 0x0045aa40
Ghidra address:
PAL: 0x004980b0

Reimplemented from Rnd::Animatable.

Member Data Documentation

◆ mNextSpawnFrame

float Rnd::Generator::mNextSpawnFrame

Frame the next instance is spawned on.

The constructor writes the sentinel -9999999.0, and the first SetFrameSelf() replaces it with the frame it receives. The dump omits it, so the title is inferred from SetFrameSelf(). Public because TnlBumpFX::Start() at 0x0043dea8 zeroes it, and the image has no accessor. +0x108


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