resonance 1.0.1
Loading...
Searching...
No Matches
lightanim.h
Go to the documentation of this file.
1#pragma once
2
3#include <list>
4
5#include "os/hxstr.h"
6#include "rnd/animatable.h"
7#include "rnd/keychannel.h"
8
9namespace Rnd {
10class Dbg;
11class Light;
12class Object;
13class Stream;
14} // namespace Rnd
15
16namespace Rnd {
17
44class LightAnim : public Animatable {
45public:
47 enum { kSerialVersion = 0 };
48
56 enum { kCopyShareKeys = 0x02 };
57
68 explicit LightAnim(const HxStr &name);
69
74 virtual ~LightAnim();
75
87
96
108 void SetKeysOwner(LightAnim *pOwner);
109
120 virtual void DumpText(Dbg &sink);
121
132 virtual void Save(Stream &stream);
133
145 virtual void Replace(Object *pFrom, Object *pTo);
146
154 virtual const HxStr &ClassName() const;
155
167 virtual void Copy(const Object *pSource, unsigned nFlags);
168
178 virtual void Load(Stream &stream);
179
192 virtual float FilteredFrameEnd();
193
194protected:
209 virtual void SetFrameSelf(float flFrame);
210
211private:
220 void ClearKeys();
221
222 // No class derives from Rnd::LightAnim and no access from outside it is recovered. Every
223 // member is therefore private. The order below is the recovered offset order, and the text
224 // dump pins all five.
225
226 // Light this animation drives. SetFrameSelf() returns without doing anything while it is null.
227 Light *mLight; // +0x18
228 // Channel that drives the ambient colour.
229 std::list<ColorKey> mAmbientKeys; // +0x1c
230 // Channel that drives the diffuse colour.
231 std::list<ColorKey> mDiffuseKeys; // +0x20
232 // Channel that drives the specular colour.
233 std::list<ColorKey> mSpecularKeys; // +0x24
234 // Animation whose channels this one reads, itself for an animation that owns its keys.
235 LightAnim *mKeysOwner; // +0x28
236};
237
245
258
271
282
283} // namespace Rnd
Heap-allocated NUL-terminated string.
Definition hxstr.h:41
Animatable()
Construct an animatable with no children, no filters, and a zero frame.
Sink that the engine formats its diagnostic and failure text into.
Definition dbg.h:33
Keyframed animation of the three colours of one Rnd::Light.
Definition lightanim.h:44
virtual void Load(Stream &stream)
Load the animation.
virtual void Save(Stream &stream)
Serialise the animation.
virtual const HxStr & ClassName() const
Report the registered class name, "LightAnim".
virtual void Replace(Object *pFrom, Object *pTo)
Retarget one object reference at another.
void SetKeysOwner(LightAnim *pOwner)
Make another animation the one whose channels drive this one.
LightAnim(const HxStr &name)
Construct an animation with three empty channels and no light, owning its keys.
virtual void DumpText(Dbg &sink)
Write the animation to the engine text sink.
virtual void SetFrameSelf(float flFrame)
Animate the light to a frame.
virtual ~LightAnim()
virtual void Copy(const Object *pSource, unsigned nFlags)
Copy another animation over this one.
@ kCopyShareKeys
Definition lightanim.h:56
LightAnim * GetKeysOwner()
Report the animation whose channels this one reads.
Light * GetLight()
Report the light this animation drives.
@ kSerialVersion
Definition lightanim.h:47
virtual float FilteredFrameEnd()
Report the last frame this animation runs to.
Light in a scene.
Definition light.h:41
Base of every object the renderer can load, resolve by name, and serialise.
Definition object.h:43
Byte stream that every renderer object serialises itself through.
Definition stream.h:31
The rendering engine.
Definition animhelper.h:3
HxStr g_lightAnimClassName
Registered class name of Rnd::LightAnim, the string "LightAnim".
void RegisterLightAnimClass()
Register the "LightAnim" class with Rnd::Manager, through CreateRegisteredLightAnim().
Object * CreateRegisteredLightAnim(const HxStr &name)
Build a light animation for the registered "LightAnim" class.
LightAnim * NewLightAnim(const HxStr &name)
Allocate and construct a light animation.