65 void *
operator new(
size_t nSize) {
66 return PoolMemAlloc(
static_cast<int>(nSize),
"Generator", 0);
74 void operator delete(
void *pBlock) {
328 mPathVarMax[nIndex] = fDegrees;
338 mRateGenHigh = fRateGenHigh;
348 mRateGenLow = fRateGenLow;
353 return mScaleGenHigh;
358 mScaleGenHigh = fScaleGenHigh;
368 mScaleGenLow = fScaleGenLow;
375 inline float InstanceXfm(
const Instance &instance,
float fDirection,
Transform &xfm);
377 std::list<Instance> mInstances;
379 float mPathStartFrame;
385 int mAnimateFromStart;
389 float mBirthSquareDist;
395 float mPathVarMax[3];
397 std::list<Transform>::iterator mCurXfm;
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
Camera.
Definition rndcam.h:23
RndDrawable()
Construct a showing drawable without a highlight or children.
Definition rnddrawable.h:23
void Copy(const RndObject *pSource, int nFlags) override
Copy another generator and its bases.
const float * GetPathVarMax() const
Definition rndgenerator.h:317
static RndObject * New(const char *pszName)
Create a generator.
Definition rndgenerator.h:297
void(RndGenerator::* DrawInstanceFunc)(float fAge, const Transform &xfm)
A routine that draws or places one instance's subject at a transform.
Definition rndgenerator.h:40
void SetScaleGenHigh(float fScaleGenHigh)
Definition rndgenerator.h:357
void SetPathVarMax(int nIndex, float fDegrees)
Set one entry of the most rotation about each axis, in degrees.
Definition rndgenerator.h:327
void Save(BinStream &stream) override
Write the generator and its bases.
void SetScaleGenLow(float fScaleGenLow)
Definition rndgenerator.h:367
void DrawView(float fAge, const Transform &xfm)
Move the view to a transform, animate it to an age when mAnimateFromStart is set, and draw it.
void ListDrawables(std::list< RndDrawable * > &drawables) override
Add the generator, when a subject of an instance would draw, then the children, to a list.
void Replace(RndObject *pFrom, RndObject *pTo) override
Replace a referenced object with another in the bases and the subjects.
RndGenerator(const char *pszName)
Construct a generator without a path or a subject that generates every 100 frames.
void SetRateGenLow(float fRateGenLow)
Definition rndgenerator.h:347
float GetScaleGenHigh() const
Definition rndgenerator.h:352
float GetRateGenHigh() const
Definition rndgenerator.h:332
static const char * sClassName
The class name a .rnd file writes, Generator.
Definition rndgenerator.h:307
void ListDrawObjects(std::list< RndObject * > &objects) override
Add the generator and the objects of the subjects to a list.
void AcquireRefs()
Take the references on the subjects, the path, and the birth camera, then give each instance a partic...
const char * ClassName() const override
Report the class name.
Definition rndgenerator.h:161
int DrawShowing() override
Draw the subject at each instance.
void SetPath(RndTransAnim *pPath, float fStart, float fEnd)
Set the path and the frames of it the instances play.
void DumpText(PrnStream &stream) override
Write a description of the generator and its bases.
float GetScaleGenLow() const
Definition rndgenerator.h:362
float GetRateGenLow() const
Definition rndgenerator.h:342
void Generate(float fFrame)
Add an instance born at a frame, unless the birth camera rules it out.
void ResetParticles()
Free the particles of the particle system, then allocate one for each instance.
void SetParticlePos(float fAge, const Transform &xfm)
Move the next particle to the position of a transform.
void Load(BinStream &stream) override
Read what Save() wrote, or an earlier version of it.
static int sRev
The format version Save() writes and Load() accepts.
Definition rndgenerator.h:314
int SetFrameSelf(float fFrame) override
Drop the instances whose path has run out, animate the view, and generate the instances due by a fram...
void ReleaseRefs()
Drop the references on the subjects, the path, and the birth camera, and the instances.
~RndGenerator() override
Drop the references and the instances.
void SetMultiMeshXfm(float fAge, const Transform &xfm)
Store a transform in the next transform of the multimesh.
void SetRateGenHigh(float fRateGenHigh)
Definition rndgenerator.h:337
void DrawMesh(float fAge, const Transform &xfm)
Move the mesh to a transform and draw it.
Triangle mesh with a material.
Definition rndmesh.h:31
Mesh drawn once at each of a list of transforms.
Definition rndmultimesh.h:17
RndObject(const char *pszName)
Construct an object and register it under a name.
Emitter that spawns, moves, and fades a population of particles.
Definition rndparticlesys.h:69
Animation of a transformable's local transform by rotation, translation, and scale keys.
Definition rndtransanim.h:20
View that shows the children of another view, its children owner, under its own transform and frame.
Definition rndview.h:27
void * PoolMemAlloc(int nSize, const char *pszTag, int nAlign)
Allocate a block from the pool heaps and bill it to a tag.
void PoolMemFree(void *pBlock)
Return a block PoolMemAlloc() handed out to the pool heap that owns it.
PrnStream & operator<<(PrnStream &stream, const RndGenerator::Instance &instance)
Write an instance's birth frame and transform.
One particle of a RndParticleSys pool.
Definition rndparticlesys.h:27
One generated instance.
Definition rndgenerator.h:33
Transform mXfm
Definition rndgenerator.h:35
float mFrame
Definition rndgenerator.h:34
Vector3 mScale
Definition rndgenerator.h:36
Three-component vector, padded to a PlayStation 2 quadword.
Definition vector3.h:14