#ifndef __C_PARTICLE_MESH_EMITTER_H_INCLUDED__
#define __C_PARTICLE_MESH_EMITTER_H_INCLUDED__
#include "IParticleMeshEmitter.h"
#include "irrArray.h"
#include "aabbox3d.h"
#include "IMeshBuffer.h"
namespace irr
{
namespace scene
{
class CParticleMeshEmitter : public IParticleMeshEmitter
{
public:
CParticleMeshEmitter(
IMesh* mesh, bool useNormalDirection = true,
const core::vector3df& direction = core::vector3df(0.0f,0.0f,0.0f),
f32 normalDirectionModifier = 100.0f,
s32 mbNumber = -1,
bool everyMeshVertex = false,
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 setMesh( IMesh* mesh );
virtual void setUseNormalDirection( bool useNormalDirection ) { UseNormalDirection = useNormalDirection; }
virtual void setDirection( const core::vector3df& newDirection ) { Direction = newDirection; }
virtual void setNormalDirectionModifier( f32 normalDirectionModifier ) { NormalDirectionModifier = normalDirectionModifier; }
virtual void setEveryMeshVertex( bool everyMeshVertex ) { EveryMeshVertex = everyMeshVertex; }
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 const IMesh* getMesh() const { return Mesh; }
virtual bool isUsingNormalDirection() const { return UseNormalDirection; }
virtual const core::vector3df& getDirection() const { return Direction; }
virtual f32 getNormalDirectionModifier() const { return NormalDirectionModifier; }
virtual bool getEveryMeshVertex() const { return EveryMeshVertex; }
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; }
private:
const IMesh* Mesh;
core::array<s32> VertexPerMeshBufferList;
s32 TotalVertices;
u32 MBCount;
s32 MBNumber;
f32 NormalDirectionModifier;
core::array<SParticle> Particles;
core::vector3df Direction;
core::dimension2df MaxStartSize, MinStartSize;
u32 MinParticlesPerSecond, MaxParticlesPerSecond;
video::SColor MinStartColor, MaxStartColor;
u32 MinLifeTime, MaxLifeTime;
u32 Time;
u32 Emitted;
s32 MaxAngleDegrees;
bool EveryMeshVertex;
bool UseNormalDirection;
};
}
}
#endif