|
resonance 1.0.1
|
Keyframed animation of one Rnd::ParticleSys. More...
#include <particlesysanim.h>


Public Types | |
| enum | { kSerialVersion = 1 } |
| Revision Save() writes, and the highest revision Load() accepts. More... | |
| enum | { kCopyShareKeys = 0x80 } |
| Bit of the copy flags that shares the source's keyframe channels rather than copying them. More... | |
| 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 Member Functions | |
| ParticleSysAnim (const HxStr &name) | |
| Construct an animation with no channels and no system that owns its own frames. | |
| virtual | ~ParticleSysAnim () |
| virtual void | DumpText (Dbg &sink) |
| Write the animation to the engine text sink. | |
| virtual void | Save (Stream &stream) |
| Serialise the animation. | |
| virtual void | Replace (Object *pFrom, Object *pTo) |
| Replace one object reference with another. | |
| virtual const HxStr & | ClassName () const |
| Return the registered class name, "ParticleSysAnim". | |
| virtual void | Copy (const Object *pSource, unsigned nFlags) |
| Copy another animation over this one. | |
| virtual void | Load (Stream &stream) |
| Load the animation. | |
| virtual float | FilteredFrameEnd () |
| Report the last frame this animation runs to. | |
| 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 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(). | |
Protected Member Functions | |
| virtual void | SetFrameSelf (float flFrame) |
| Animate the system to a frame. | |
| void | SetParticleSys (ParticleSys *pParticleSys) |
| Make a particle system the one this animation drives. | |
| void | SetFramesOwner (ParticleSysAnim *pOwner) |
| Make another animation the one whose keyframes drive this one. | |
| Protected Member Functions inherited from Rnd::Object | |
| void | ReleaseAllRefs () |
| Tell every referrer to drop its pointer to this object. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from Rnd::Animatable | |
| static Filter * | NewFilter (int nType) |
| Build one default-constructed filter for a type tag. | |
| 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 |
| Protected Attributes inherited from Rnd::Object | |
| std::list< Object * > | mRefs |
Keyframed animation of one Rnd::ParticleSys.
Its RTTI descriptor is at 0x008f0eb0. It has Rnd::Animatable as its one public base at offset
Two vtables belong to the class, each identified by its own GetTypeInfo slot addressing 0x0052b7f0. The Object subobject table at 0x00827a80 stores the seven Object overrides, and the Animatable table at 0x00827ac8 stores FilteredFrameEnd() at slot 1 and SetFrameSelf() at slot 3. Slot 2 still addresses the base StartAnim() at 0x0049a3b8, so restarting an animation does nothing of its own here.
Three channels drive the system, and the text dump labels them "startColorKeys:", "endColorKeys:", and "emitRateKeys:". The two colour channels are std::list of Rnd::ColorKey and share the dump routine at 0x004d8de8. The emission rate channel is a std::list of Rnd::FloatKey and has its own dump at 0x004d8f08. FilteredFrameEnd() reads the frame of the two colour channels at list node +0x20 and of the rate channel at node +0x0c, which is the two element sizes rather than one.
Keys are shared rather than copied, the same arrangement Rnd::MeshAnim uses with mKeysOwner. Both FilteredFrameEnd() and SetFrameSelf() read the channels of mFramesOwner rather than their own, so an animation whose frames belong to another animation reads that object's keys.
SetFrameSelf() is blocked rather than unrecovered; see its own documentation.
| anonymous enum |
| anonymous enum |
Bit of the copy flags that shares the source's keyframe channels rather than copying them.
Recovered from the andi at 0x0052706c in Copy(). Rnd::MeshAnim reads bit 0x40 and Rnd::LightAnim bit 0x02 for the same purpose, so the bit is per class rather than shared across the hierarchy.
| Enumerator | |
|---|---|
| kCopyShareKeys | |
| Rnd::ParticleSysAnim::ParticleSysAnim | ( | const HxStr & | name | ) |
Construct an animation with no channels and no system that owns its own frames.
mEmitRateRatio starts at zero. Rnd::NewParticleSysAnim() is the only construction site.
| name | The object name, passed to the Rnd::Object constructor. |
|
virtual |
|
virtual |
Write the animation to the engine text sink.
Emits the Object and Animatable dumps, then the "[ParticleSysAnim]" block. The block is suppressed while the dump level of the sink is not positive.
| sink | The text sink. |
Reimplemented from Rnd::Animatable.
|
virtual |
Serialise the animation.
Writes kSerialVersion, the Rnd::Animatable subobject, mParticleSys as a name, the three channels, mFramesOwner as a name, and finally mEmitRateRatio.
| stream | The stream to write to. |
Reimplemented from Rnd::Animatable.
Replace one object reference with another.
| pFrom | The object being replaced. |
| pTo | The object to point at, which may be null. |
Reimplemented from Rnd::Animatable.
|
virtual |
Return the registered class name, "ParticleSysAnim".
Implements Rnd::Object.
|
virtual |
Copy another animation over this one.
kCopyShareKeys shares the source's channels instead of copying them, and a source that is itself sharing is always shared from rather than copied. mEmitRateRatio is copied either way.
| pSource | The source object, which has to be an animation for the copy to have any effect. |
| nFlags | The copy flags. |
Reimplemented from Rnd::Animatable.
|
virtual |
Load the animation.
Reports "Can't load new ParticleSysAnim" through the failure sink when the file version exceeds what this build writes.
| stream | The stream to read from. |
Reimplemented from Rnd::Animatable.
|
virtual |
Report the last frame this animation runs to.
Rnd::Animatable vtable slot 1. Counts the keys of each channel of mFramesOwner and reports the frame of the last key across the three, taking the frame from the final list node of each. An empty channel contributes zero.
Reimplemented from Rnd::Animatable.
|
protectedvirtual |
Animate the system to a frame.
Rnd::Animatable vtable slot 3. Returns at once when mParticleSys is null. Each of the two colour channels of mFramesOwner selects the bracketing keyframe pair, blends the pair on VU0, and then moves one spawn colour range of the system so that the blended colour becomes the low end while the spread of the range survives. The move is AddColor() followed by SubColor().
The emission rate channel interpolates its two scalars linearly instead, then divides Rnd::ParticleSys::mEmitRateHigh by mEmitRateLow into mEmitRateRatio whenever the second is not zero, and finally writes the interpolated rate to mEmitRateLow and that rate scaled by mEmitRateRatio to mEmitRateHigh. An empty rate channel finishes the routine.
| flFrame | The filtered frame to animate to. |
Reimplemented from Rnd::Animatable.
|
protected |
Make a particle system the one this animation drives.
Moves this object's reference from the previous system to the new one. No call site survives in the shipped program, and the name is inferred.
| pParticleSys | The new system, or null. |
|
protected |
Make another animation the one whose keyframes drive this one.
Moves this object's reference from the previous owner to the new one, and then empties this object's own channels unless it is its own owner. No call site survives in the shipped program, and the name follows the Rnd::TransAnim counterpart.
| pOwner | The new frames owner, or null. |