#ifndef __C_PARTICLE_SPHERE_EMITTER_H_INCLUDED__
#define __C_PARTICLE_SPHERE_EMITTER_H_INCLUDED__
#include "IParticleSphereEmitter.h"
#include "irrArray.h"
#include "aabbox3d.h"
namespace irr
{
namespace scene
{
class CParticleSphereEmitter : public IParticleSphereEmitter
{
public:
CParticleSphereEmitter(
const core::vector3df& center, f32 radius,
const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
u32 minParticlesPerSecond = 20,
u32 maxParticlesPerSecond = 40,
const video::SColor& minStartColor = video::SColor(255,0,0,0),
const video::SColor& maxStartColor = video::SColor(255,255,255,255),
u32 lifeTimeMin=2000,
u32 lifeTimeMax=4000,
s32 maxAngleDegrees=0,
const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f),
const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) );
virtual s32 emitt(u32 now, u32 timeSinceLastCall, SParticle*& outArray);
virtual void setDirection( const core::vector3df& newDirection ) { Direction = newDirection; }
virtual void setMinParticlesPerSecond( u32 minPPS ) { MinParticlesPerSecond = minPPS; }
virtual void setMaxParticlesPerSecond( u32 maxPPS ) { MaxParticlesPerSecond = maxPPS; }
virtual void setMinStartColor( const video::SColor& color ) { MinStartColor = color; }
virtual void setMaxStartColor( const video::SColor& color ) { MaxStartColor = color; }
virtual void setMaxStartSize( const core::dimension2df& size ) { MaxStartSize = size; }
virtual void setMinStartSize( const core::dimension2df& size ) { MinStartSize = size; }
virtual void setMinLifeTime( u32 lifeTimeMin ) { MinLifeTime = lifeTimeMin; }
virtual void setMaxLifeTime( u32 lifeTimeMax ) { MaxLifeTime = lifeTimeMax; }
virtual void setMaxAngleDegrees( s32 maxAngleDegrees ) { MaxAngleDegrees = maxAngleDegrees; }
virtual void setCenter( const core::vector3df& center ) { Center = center; }
virtual void setRadius( f32 radius ) { Radius = radius; }
virtual const core::vector3df& getDirection() const { return Direction; }
virtual u32 getMinParticlesPerSecond() const { return MinParticlesPerSecond; }
virtual u32 getMaxParticlesPerSecond() const { return MaxParticlesPerSecond; }
virtual const video::SColor& getMinStartColor() const { return MinStartColor; }
virtual const video::SColor& getMaxStartColor() const { return MaxStartColor; }
virtual const core::dimension2df& getMaxStartSize() const { return MaxStartSize; }
virtual const core::dimension2df& getMinStartSize() const { return MinStartSize; }
virtual u32 getMinLifeTime() const { return MinLifeTime; }
virtual u32 getMaxLifeTime() const { return MaxLifeTime; }
virtual s32 getMaxAngleDegrees() const { return MaxAngleDegrees; }
virtual const core::vector3df& getCenter() const { return Center; }
virtual f32 getRadius() const { return Radius; }
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
private:
core::array<SParticle> Particles;
core::vector3df Center;
f32 Radius;
core::vector3df Direction;
core::dimension2df MinStartSize, MaxStartSize;
u32 MinParticlesPerSecond, MaxParticlesPerSecond;
video::SColor MinStartColor, MaxStartColor;
u32 MinLifeTime, MaxLifeTime;
u32 Time;
u32 Emitted;
s32 MaxAngleDegrees;
};
}
}
#endif