|
resonance 1.0.1
|
Keyframed animation of the three colours of one Rnd::Light. More...
#include <lightanim.h>


Public Types | |
| enum | { kSerialVersion = 0 } |
| Revision Save() writes, and the highest revision Load() accepts. More... | |
| enum | { kCopyShareKeys = 0x02 } |
| 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 | |
| LightAnim (const HxStr &name) | |
| Construct an animation with three empty channels and no light, owning its keys. | |
| virtual | ~LightAnim () |
| Light * | GetLight () |
| Report the light this animation drives. | |
| LightAnim * | GetKeysOwner () |
| Report the animation whose channels this one reads. | |
| void | SetKeysOwner (LightAnim *pOwner) |
| Make another animation the one whose channels drive this one. | |
| 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) |
| Retarget one object reference at another. | |
| virtual const HxStr & | ClassName () const |
| Report the registered class name, "LightAnim". | |
| 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 light to a frame. | |
| 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 the three colours of one Rnd::Light.
Its RTTI descriptor is at 0x008ef1f0. It has Rnd::Animatable as its one public base at offset
Two vtables belong to the class, each with the accessor at 0x00544940 in slot 0. The Object subobject table at 0x00829448 stores the seven Object overrides and the destructor, and the Animatable table at 0x00829490 stores FilteredFrameEnd() at slot 1 and SetFrameSelf() at slot
Three channels drive the light, and the text dump labels them "ambientKeys:", "diffuseKeys:", and "specularKeys:". SetFrameSelf() hands the three interpolated results to Rnd::Light::SetColors() in that order, which is independent confirmation of that parameter order. Each channel is a std::list of Rnd::ColorKey, the same arrangement Rnd::MatAnim and Rnd::ParticleSysAnim use, and the shared channel dump at 0x004d8de8 serves all three classes.
Keys are shared rather than copied, the same arrangement Rnd::MeshAnim uses with mKeysOwner. Both FilteredFrameEnd() and SetFrameSelf() read the channels of mKeysOwner rather than their own. An animation whose keys belong to another animation therefore reads that object's keys.
| 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 0x005416dc in Copy(). Rnd::MeshAnim reads bit 0x40 and Rnd::ParticleSysAnim bit 0x80 for the same purpose, so the bit is per class rather than shared across the hierarchy.
| Enumerator | |
|---|---|
| kCopyShareKeys | |
|
explicit |
Construct an animation with three empty channels and no light, owning its keys.
NewLightAnim() is the one construction site and allocates 0x48 untagged bytes before invoking it.
| name | The object name, passed to the Rnd::Object constructor. |
|
virtual |
| Light * Rnd::LightAnim::GetLight | ( | ) |
Report the light this animation drives.
The body is one load in a branch delay slot, and it is an accessor rather than an asserted member only because the image emits it out of line at its own address.
| LightAnim * Rnd::LightAnim::GetKeysOwner | ( | ) |
Report the animation whose channels this one reads.
| void Rnd::LightAnim::SetKeysOwner | ( | LightAnim * | pOwner | ) |
Make another animation the one whose channels 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 GetKeysOwner().
| pOwner | The new keys owner, or null. |
|
virtual |
Write the animation to the engine text sink.
Emits the Object and Animatable dumps, then the "[LightAnim]" 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, mLight as a name, the three channels, and finally mKeysOwner as a name.
| stream | The stream to write to. |
Reimplemented from Rnd::Animatable.
Retarget one object reference at another.
A null pTo means the animation that owned the shared keys is going away, and the three channels are taken over from that owner rather than emptied.
| pFrom | The object being replaced. |
| pTo | The replacement, or null. |
Reimplemented from Rnd::Animatable.
|
virtual |
Report the registered class name, "LightAnim".
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.
| pSource | The object to copy from. |
| nFlags | The set of fields to copy. |
Reimplemented from Rnd::Animatable.
|
virtual |
Load the animation.
A revision above 0 produces the report "Can't load new LightAnim" and no further reading.
| stream | The stream to read from. |
Reimplemented from Rnd::Animatable.
|
virtual |
Report the last frame this animation runs to.
Rnd::Animatable vtable slot 1. Each channel of mKeysOwner contributes the frame of its last key, or zero while it is empty, and the result is the largest of the three through two nested std::max calls. The pair of selected stack addresses rather than selected values proves the two calls.
Reimplemented from Rnd::Animatable.
|
protectedvirtual |
Animate the light to a frame.
Rnd::Animatable vtable slot 3. Returns at once while mLight is null. Otherwise it seeds three local colours from the current ambient, diffuse, and specular of the light, then replaces each from its channel of mKeysOwner. A frame at or before the first key takes that key, a frame at or after the last key takes that key, and a frame between two keys takes the linear blend of the pair on VU0. An empty channel is skipped, which retains the light's own colour. Rnd::Light::SetColors() receives the three results.
| flFrame | The filtered frame to animate to. |
Reimplemented from Rnd::Animatable.