wavelength 1.0.0
Loading...
Searching...
No Matches
rndparticlesysanim.h
Go to the documentation of this file.
1#pragma once
2
3#include <list>
4#include <vector>
5
6#include "math/color.h"
7#include "math/key.h"
8#include "os/binstream.h"
9#include "os/prnstream.h"
10#include "rnd/rndanimatable.h"
11#include "rnd/rndparticlesys.h"
12
23public:
25 static constexpr int kCopyShareKeys = 0x80;
26
34 explicit RndParticleSysAnim(const char *pszName);
35
43
51 float EndFrame() override;
52
60 void ListAnimObjects(std::list<RndObject *> &objects) override;
61
72 int SetFrameSelf(float fFrame) override;
73
81 void DumpText(PrnStream &stream) override;
82
90 void Save(BinStream &stream) override;
91
103 void Replace(RndObject *pFrom, RndObject *pTo) override;
104
112 const char *ClassName() const override {
113 return sClassName;
114 }
115
127 void Copy(const RndObject *pSource, int nFlags) override;
128
138 void Load(BinStream &stream) override;
139
148 static RndObject *New(const char *pszName) {
149 return new RndParticleSysAnim(pszName);
150 }
151
158 static const char *sClassName;
159
166 static int sRev;
167
168protected:
178
188
189private:
190 RndParticleSys *mParticleSys;
191 std::vector<Key<Color>> mStartColorKeys;
192 std::vector<Key<Color>> mEndColorKeys;
193 std::vector<Key<float>> mEmitRateKeys;
194 RndParticleSysAnim *mFramesOwner;
195 float mEmitRateRatio;
196};
Stream of raw bytes, the base of the memory, file, and network streams.
Definition binstream.h:22
Text output stream.
Definition prnstream.h:16
RndAnimatable()
Construct an animatable at frame 0 without children or filters.
Definition rndanimatable.h:600
RndObject(const char *pszName)
Construct an object and register it under a name.
RndParticleSysAnim(const char *pszName)
Construct an animation of nothing without keys.
const char * ClassName() const override
Report the class name.
Definition rndparticlesysanim.h:112
void ListAnimObjects(std::list< RndObject * > &objects) override
Add the particle system to a list, then the objects of the children.
static const char * sClassName
The class name a .rnd file writes, ParticleSysAnim.
Definition rndparticlesysanim.h:158
void Load(BinStream &stream) override
Read what Save() wrote, or an earlier version of it.
int SetFrameSelf(float fFrame) override
Apply a frame to the particle system.
void AcquireRefs()
Take references on the particle system and the frames owner.
static constexpr int kCopyShareKeys
The bit of the Copy() flags that shares the source's keys rather than copying them.
Definition rndparticlesysanim.h:25
static int sRev
The format version Save() writes and Load() accepts.
Definition rndparticlesysanim.h:166
void DumpText(PrnStream &stream) override
Write a description of the animation and its base.
void Replace(RndObject *pFrom, RndObject *pTo) override
Replace the particle system or the frames owner with another object.
void Save(BinStream &stream) override
Write the animation and its base.
float EndFrame() override
Report the frame of the last key of any channel of the frames owner.
void ReleaseRefs()
Drop the references on the particle system and the frames owner.
~RndParticleSysAnim() override
Drop the references on the particle system and the frames owner.
static RndObject * New(const char *pszName)
Create an animation.
Definition rndparticlesysanim.h:148
void Copy(const RndObject *pSource, int nFlags) override
Copy another animation and its base.
Emitter that spawns, moves, and fades a population of particles.
Definition rndparticlesys.h:69