|
wavelength 1.0.0
|
Mix-in for an object driven by a frame. More...
#include <rndanimatable.h>


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 |
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.
The type tags of the filters, as Save() writes them.
| Enumerator | |
|---|---|
| kFilterScaleOffset | |
| kFilterMinMaxLoop | |
| kFilterZeroOrder | |
| kFilterFirstOrder | |
| kFilterSecondOrder | |
|
inline |
Construct an animatable at frame 0 without children or filters.
The constructor has no out-of-line copy.
|
override |
Drop the references on the children and delete the filters.
|
virtual |
Report the frame at which the animation ends.
The base reports the latest end of the children, each taken back through its filters.
Reimplemented in PsMovie, RndCursor, RndLightAnim, RndMatAnim, RndMeshAnim, RndParticleSysAnim, and RndTransAnim.
|
virtual |
Add the objects the animation uses to a list.
The base body adds the objects of the children. The name is inferred.
| objects | The list to add to. |
Reimplemented in RndLightAnim, RndMatAnim, RndMeshAnim, RndMovie, RndParticleSysAnim, and RndTransAnim.
|
inlinevirtual |
Apply a filtered frame to this object alone.
The base body does nothing. The name is inferred.
| fFrame | The filtered frame. |
Reimplemented in PsMovie, RndArena, RndGenerator, RndLightAnim, RndMatAnim, RndMeshAnim, RndParticleSys, RndParticleSysAnim, RndTransAnim, and RndView.
|
overridevirtual |
Write a description of the animatable.
Nothing is written unless the dump level of the stream is above 0.
| stream | The stream to write to. |
Reimplemented from RndObject.
Reimplemented in RndArena, RndCursor, RndGenerator, RndLightAnim, RndMatAnim, RndMeshAnim, RndMovie, RndParticleSys, RndParticleSysAnim, RndTransAnim, and RndView.
|
overridevirtual |
Write the filters and the names of the children.
| stream | The stream to write to. |
Implements RndObject.
Reimplemented in RndArena, RndCursor, RndGenerator, RndLightAnim, RndMatAnim, RndMeshAnim, RndMovie, RndParticleSys, RndParticleSysAnim, RndTransAnim, and RndView.
Replace a child with another object.
A replacement that is not an animatable, or null, removes the child.
| pFrom | The object being replaced. |
| pTo | The replacement, or null. |
Implements RndObject.
Reimplemented in RndArena, RndCursor, RndGenerator, RndLightAnim, RndMatAnim, RndMeshAnim, RndMovie, RndParticleSys, RndParticleSysAnim, RndTransAnim, and RndView.
|
overridevirtual |
Copy the filters, and the children when the flags request them.
| pSource | The animatable to copy from. |
| nFlags | The set of fields to copy. RndObject::kCopyChildLists copies the children. |
Implements RndObject.
Reimplemented in RndArena, RndCursor, RndGenerator, RndLightAnim, RndMatAnim, RndMeshAnim, RndMovie, RndParticleSys, RndParticleSysAnim, RndTransAnim, and RndView.
|
overridevirtual |
Read what Save() wrote.
| stream | The stream to read from. |
Implements RndObject.
Reimplemented in RndArena, RndCursor, RndGenerator, RndLightAnim, RndMatAnim, RndMeshAnim, RndMovie, RndParticleSys, RndParticleSysAnim, RndTransAnim, and RndView.
| RndAnimatable * RndAnimatable::Parent | ( | ) |
Find the animatable whose children include this one.
| void RndAnimatable::SetFrame | ( | float | fFrame | ) |
Filter a frame, apply it, and pass the result on to the children.
| fFrame | The frame. |
| float RndAnimatable::FilterFrame | ( | float | fValue | ) |
Run a frame through the filters.
| fValue | The frame. |
| float RndAnimatable::UnfilterFrame | ( | float | fValue | ) |
Run a filtered frame back through the filters, last first.
| fValue | The filtered frame. |
| 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).
| bool RndAnimatable::AddAnim | ( | RndAnimatable * | pAnim | ) |
Append a child.
An animatable already among the children is not added again.
| pAnim | The new child. |
| void RndAnimatable::RemoveAnim | ( | RndAnimatable * | pAnim | ) |
Remove a child.
| pAnim | The child. |
| void RndAnimatable::RemoveAllAnims | ( | ) |
Remove every child.
|
static |
Create a filter stage of a type, with its parameters unset.
An unknown type warns and yields null.
| nType | The FilterType. |
|
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.
| objects | The list to append to. |
| pAnimatable | The animatable to start from, or null. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
Drop the references on the children without emptying the list, and delete the filters.
The name is inferred.
|
protected |
Take a reference on every child.
The name is inferred.
|
static |
|
protected |
The children. Each receives the filtered frame.
|
protected |
The filter chain, applied first to last.
|
protected |
The frame SetFrame() last received.
|
protected |
The frame after the filters.