34 void *
operator new[](
size_t nSize) {
35 return PoolMemAlloc(
static_cast<int>(nSize),
"Particle", 0);
43 void operator delete[](
void *pBlock) {
106 void *
operator new(
size_t nSize) {
107 return PoolMemAlloc(
static_cast<int>(nSize),
"ParticleSys", 0);
115 void operator delete(
void *pBlock) {
392 return mBubblePeriod;
397 mBubblePeriod = range;
427 return mCollidePlane;
432 mCollidePlane = plane;
447 return mEndColorHigh;
452 return mEndColorHigh;
457 mEndColorHigh = color;
472 mEndColorLow = color;
522 return mNumParticles;
527 return mParticlesOwner;
607 return mStartColorHigh;
612 return mStartColorHigh;
617 mStartColorHigh = color;
622 return mStartColorLow;
627 return mStartColorLow;
632 mStartColorLow = color;
678 float mLastEmitFrame;
679 float mEmitAccumulator;
680 std::list<RndParticleSys *> mSharers;
691 Color mStartColorLow;
692 Color mStartColorHigh;
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
RndDrawable()
Construct a showing drawable without a highlight or children.
Definition rnddrawable.h:23
Surface description: blending, lighting colours, culling, and a list of texture stages.
Definition rndmat.h:20
RndObject(const char *pszName)
Construct an object and register it under a name.
Vector3 & GetForce()
Definition rndparticlesys.h:481
void SetMat(RndMat *pMat)
Set the material the particles are drawn with.
void SetBubbleSize(const Vector2 &range)
Definition rndparticlesys.h:411
Vector2 & GetSize()
Definition rndparticlesys.h:586
Particle * mLiveParticles
Definition rndparticlesys.h:668
int GetBubble() const
Definition rndparticlesys.h:381
void SetStartColorHigh(const Color &color)
Definition rndparticlesys.h:616
void DumpText(PrnStream &stream) override
Write a description of the system and its bases.
const Color & GetEndColorHigh() const
Definition rndparticlesys.h:446
void ResetEmitFrame()
Return the emission clock to SetFrameSelf().
const Vector2 & GetBubblePeriod() const
Definition rndparticlesys.h:391
static int sLoadRev
The version Load() read last.
Definition rndparticlesys.h:371
Vector3 & GetPosLow()
Definition rndparticlesys.h:561
void Load(BinStream &stream) override
Read what Save() wrote, or an earlier version of it.
const Vector3 & GetPosLow() const
Definition rndparticlesys.h:556
const Vector3 & GetPosHigh() const
Definition rndparticlesys.h:541
Vector2 & GetBubbleSize()
Definition rndparticlesys.h:406
Mode GetMode() const
Definition rndparticlesys.h:511
std::unique_ptr< Particle[]> mParticles
Definition rndparticlesys.h:378
void SetPitch(const Vector2 &range)
Definition rndparticlesys.h:536
const Plane & GetCollidePlane() const
Definition rndparticlesys.h:426
const Vector3 & GetForce() const
Definition rndparticlesys.h:476
int GetCollide() const
Definition rndparticlesys.h:416
void SetStartColorLow(const Color &color)
Definition rndparticlesys.h:631
const Vector2 & GetSize() const
Definition rndparticlesys.h:581
~RndParticleSys() override
Free the particles and the pool.
void ListDrawObjects(std::list< RndObject * > &objects) override
Add the system, the material, and the textures of the material's stages, last first,...
const Color & GetEndColorLow() const
Definition rndparticlesys.h:461
Mode mMode
Definition rndparticlesys.h:670
void SetBubblePeriod(const Vector2 &range)
Definition rndparticlesys.h:396
void SetBubble(int nBubble)
Definition rndparticlesys.h:386
Vector2 & GetSpeed()
Definition rndparticlesys.h:596
void SetParticlesOwner(RndParticleSys *pOwner)
Set the system whose pool this one draws from.
void SetEndColorHigh(const Color &color)
Definition rndparticlesys.h:456
int mReadZ
Definition rndparticlesys.h:671
void SetReadZ(int nReadZ)
Definition rndparticlesys.h:576
Color & GetStartColorLow()
Definition rndparticlesys.h:626
int SetFrameSelf(float fFrame) override
Move the particles on to a frame, then emit for the elapsed frames unless SetEmitFrame() clocks the e...
const char * ClassName() const override
Report the class name.
Definition rndparticlesys.h:193
void SetSpeed(const Vector2 &range)
Definition rndparticlesys.h:601
RndMat * mMat
Definition rndparticlesys.h:669
const Color & GetStartColorLow() const
Definition rndparticlesys.h:621
void SetPosHigh(const Vector3 &pos)
Definition rndparticlesys.h:551
int NumLiveParticles() const
Report the number of live particles.
Color & GetEndColorLow()
Definition rndparticlesys.h:466
static constexpr int kCopyShareParticles
The bit of the Copy() flags that shares the source's pool rather than allocating one.
Definition rndparticlesys.h:79
void AddObjectRefs()
Take the references on the material and the owner, and prepare the pool.
void RandomizeColorAndSize(Particle *pParticle)
Give a particle a colour and a size from the start ranges.
const Color & GetStartColorHigh() const
Definition rndparticlesys.h:606
const Vector2 & GetLife() const
Definition rndparticlesys.h:491
int GetReadZ() const
Definition rndparticlesys.h:571
Color & GetEndColorHigh()
Definition rndparticlesys.h:451
void SetCollidePlane(const Plane &plane)
Definition rndparticlesys.h:431
Mode
The primitive each particle is drawn as.
Definition rndparticlesys.h:72
@ kModeSprite
Definition rndparticlesys.h:75
@ kModeLine
Definition rndparticlesys.h:74
@ kModePoint
Definition rndparticlesys.h:73
const Vector2 & GetYaw() const
Definition rndparticlesys.h:636
static const char * sClassName
The class name a .rnd file writes, ParticleSys.
Definition rndparticlesys.h:357
Color & GetStartColorHigh()
Definition rndparticlesys.h:611
const Vector2 & GetBubbleSize() const
Definition rndparticlesys.h:401
void Copy(const RndObject *pSource, int nFlags) override
Copy another system and its bases.
Particle * GetLiveParticles() const
Definition rndparticlesys.h:506
RndParticleSys(const char *pszName)
Construct a system with a pool of 10 particles.
RndParticleSys * GetParticlesOwner() const
Definition rndparticlesys.h:526
const Vector2 & GetPitch() const
Definition rndparticlesys.h:531
void Replace(RndObject *pFrom, RndObject *pTo) override
Replace a referenced object with another in the bases, the material, and the pool owner.
static int sRev
The format version Save() writes and Load() accepts.
Definition rndparticlesys.h:364
Particle * GetParticles() const
Definition rndparticlesys.h:374
void SetCollide(int nCollide)
Definition rndparticlesys.h:421
void RemoveObjectRefs()
Drop the references on the material and the owner, free the live particles, and withdraw from the sha...
Particle * AllocParticle()
Move a particle from the free list of the owner to the head of the live list.
void SetLife(const Vector2 &range)
Definition rndparticlesys.h:501
void FreeAllParticles()
Free every live particle.
int GetNumParticles() const
Definition rndparticlesys.h:521
static RndObject * New(const char *pszName)
Create a system.
Definition rndparticlesys.h:347
void Save(BinStream &stream) override
Write the system and its bases.
void SetNumParticles(int nCount)
Set the pool size, then reallocate the pool of the owner.
void SetPosLow(const Vector3 &pos)
Definition rndparticlesys.h:566
Vector2 & GetEmitRate()
Definition rndparticlesys.h:441
Vector3 & GetPosHigh()
Definition rndparticlesys.h:546
const Vector2 & GetSpeed() const
Definition rndparticlesys.h:591
void SpawnParticles(float fDelta)
Emit the particles the emission rate owes for a number of frames.
void SetEmitFrame(float fFrame)
Emit for the frames since the previous call, and clock the emission from then on in place of SetFrame...
Vector2 & GetLife()
Definition rndparticlesys.h:496
void UpdateParticles(float fDelta)
Free the particles outside their lives, and move and fade the others over a number of frames.
void SetYaw(const Vector2 &range)
Definition rndparticlesys.h:641
const Vector2 & GetEmitRate() const
Definition rndparticlesys.h:436
void SetEndColorLow(const Color &color)
Definition rndparticlesys.h:471
Particle * FreeParticle(Particle *pParticle)
Move a live particle to the free list of the owner.
void SetForce(const Vector3 &force)
Definition rndparticlesys.h:486
void ListDrawables(std::list< RndDrawable * > &drawables) override
Add the system, when a live particle is inside the view volume of the current camera,...
void SetMode(Mode pMode)
Definition rndparticlesys.h:516
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.
BinStream & operator>>(BinStream &stream, std::list< Plane > &planes)
Read a list of planes, each as a point on it followed by its normal.
PrnStream & operator<<(PrnStream &stream, const Particle &particle)
Write a particle's position, velocity, colours, size, and life.
Linear colour with four float components.
Definition color.h:12
One particle of a RndParticleSys pool.
Definition rndparticlesys.h:27
float mDeathFrame
Definition rndparticlesys.h:55
Vector3 mVel
Definition rndparticlesys.h:50
float mSize
Definition rndparticlesys.h:54
float mBubblePhase
Definition rndparticlesys.h:53
float mBirthFrame
Definition rndparticlesys.h:56
Particle * mPrev
Definition rndparticlesys.h:57
Vector3 mPos
Definition rndparticlesys.h:49
Particle * mNext
Definition rndparticlesys.h:58
Color mColVel
Definition rndparticlesys.h:48
float mBubbleFrequency
Definition rndparticlesys.h:52
Vector3 mBubbleSize
Definition rndparticlesys.h:51
Color mCol
Definition rndparticlesys.h:47
Plane equation, padded to a PlayStation 2 quadword.
Definition plane.h:15
Two-component vector, used for texture coordinates.
Definition vector2.h:12
Three-component vector, padded to a PlayStation 2 quadword.
Definition vector3.h:14