Irrlicht 3D Engine
IParticleSystemSceneNode.h
Go to the documentation of this file.
00001 // Copyright (C) 2002-2012 Nikolaus Gebhardt
00002 // This file is part of the "Irrlicht Engine".
00003 // For conditions of distribution and use, see copyright notice in irrlicht.h
00004 
00005 #ifndef __I_PARTICLE_SYSTEM_SCENE_NODE_H_INCLUDED__
00006 #define __I_PARTICLE_SYSTEM_SCENE_NODE_H_INCLUDED__
00007 
00008 #include "ISceneNode.h"
00009 #include "IParticleAnimatedMeshSceneNodeEmitter.h"
00010 #include "IParticleBoxEmitter.h"
00011 #include "IParticleCylinderEmitter.h"
00012 #include "IParticleMeshEmitter.h"
00013 #include "IParticleRingEmitter.h"
00014 #include "IParticleSphereEmitter.h"
00015 #include "IParticleAttractionAffector.h"
00016 #include "IParticleFadeOutAffector.h"
00017 #include "IParticleGravityAffector.h"
00018 #include "IParticleRotationAffector.h"
00019 #include "dimension2d.h"
00020 
00021 namespace irr
00022 {
00023 namespace scene
00024 {
00025 
00027 
00046 class IParticleSystemSceneNode : public ISceneNode
00047 {
00048 public:
00049 
00051     IParticleSystemSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
00052         const core::vector3df& position = core::vector3df(0,0,0),
00053         const core::vector3df& rotation = core::vector3df(0,0,0),
00054         const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f))
00055             : ISceneNode(parent, mgr, id, position, rotation, scale) {}
00056 
00058     virtual void setParticleSize(
00059         const core::dimension2d<f32> &size = core::dimension2d<f32>(5.0f, 5.0f)) = 0;
00060 
00062 
00065     virtual void setParticlesAreGlobal(bool global=true) = 0;
00066 
00068     virtual void clearParticles() = 0;
00069 
00073     virtual void doParticleSystem(u32 time) = 0;
00074 
00076 
00077     virtual IParticleEmitter* getEmitter() =0;
00078 
00080 
00086     virtual void setEmitter(IParticleEmitter* emitter) = 0;
00087 
00089 
00100     virtual void addAffector(IParticleAffector* affector) = 0;
00101 
00103 
00104     virtual const core::list<IParticleAffector*>& getAffectors() const = 0;
00105 
00107     virtual void removeAllAffectors() = 0;
00108 
00110 
00153     virtual IParticleAnimatedMeshSceneNodeEmitter* createAnimatedMeshSceneNodeEmitter(
00154         scene::IAnimatedMeshSceneNode* node, bool useNormalDirection = true,
00155         const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
00156         f32 normalDirectionModifier = 100.0f, s32 mbNumber = -1,
00157         bool everyMeshVertex = false,
00158         u32 minParticlesPerSecond = 5, u32 maxParticlesPerSecond = 10,
00159         const video::SColor& minStartColor = video::SColor(255,0,0,0),
00160         const video::SColor& maxStartColor = video::SColor(255,255,255,255),
00161         u32 lifeTimeMin = 2000, u32 lifeTimeMax = 4000,
00162         s32 maxAngleDegrees = 0,
00163         const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f),
00164         const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0;
00165 
00167 
00193     virtual IParticleBoxEmitter* createBoxEmitter(
00194         const core::aabbox3df& box = core::aabbox3df(-10,28,-10,10,30,10),
00195         const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
00196         u32 minParticlesPerSecond = 5,
00197         u32 maxParticlesPerSecond = 10,
00198         const video::SColor& minStartColor = video::SColor(255,0,0,0),
00199         const video::SColor& maxStartColor = video::SColor(255,255,255,255),
00200         u32 lifeTimeMin=2000, u32 lifeTimeMax=4000,
00201         s32 maxAngleDegrees=0,
00202         const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f),
00203         const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0;
00204 
00206 
00237     virtual IParticleCylinderEmitter* createCylinderEmitter(
00238         const core::vector3df& center, f32 radius,
00239         const core::vector3df& normal, f32 length,
00240         bool outlineOnly = false,
00241         const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
00242         u32 minParticlesPerSecond = 5, u32 maxParticlesPerSecond = 10,
00243         const video::SColor& minStartColor = video::SColor(255,0,0,0),
00244         const video::SColor& maxStartColor = video::SColor(255,255,255,255),
00245         u32 lifeTimeMin = 2000, u32 lifeTimeMax = 4000,
00246         s32 maxAngleDegrees = 0,
00247         const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f),
00248         const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0;
00249 
00251 
00293     virtual IParticleMeshEmitter* createMeshEmitter(
00294         scene::IMesh* mesh, bool useNormalDirection = true,
00295         const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
00296         f32 normalDirectionModifier = 100.0f, s32 mbNumber = -1,
00297         bool everyMeshVertex = false,
00298         u32 minParticlesPerSecond = 5, u32 maxParticlesPerSecond = 10,
00299         const video::SColor& minStartColor = video::SColor(255,0,0,0),
00300         const video::SColor& maxStartColor = video::SColor(255,255,255,255),
00301         u32 lifeTimeMin = 2000, u32 lifeTimeMax = 4000,
00302         s32 maxAngleDegrees = 0,
00303         const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f),
00304         const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0;
00305 
00307 
00332     virtual IParticlePointEmitter* createPointEmitter(
00333         const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
00334         u32 minParticlesPerSecond = 5,
00335         u32 maxParticlesPerSecond = 10,
00336         const video::SColor& minStartColor = video::SColor(255,0,0,0),
00337         const video::SColor& maxStartColor = video::SColor(255,255,255,255),
00338         u32 lifeTimeMin=2000, u32 lifeTimeMax=4000,
00339         s32 maxAngleDegrees=0,
00340         const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f),
00341         const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0;
00342 
00344 
00374     virtual IParticleRingEmitter* createRingEmitter(
00375         const core::vector3df& center, f32 radius, f32 ringThickness,
00376         const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
00377         u32 minParticlesPerSecond = 5,
00378         u32 maxParticlesPerSecond = 10,
00379         const video::SColor& minStartColor = video::SColor(255,0,0,0),
00380         const video::SColor& maxStartColor = video::SColor(255,255,255,255),
00381         u32 lifeTimeMin=2000, u32 lifeTimeMax=4000,
00382         s32 maxAngleDegrees=0,
00383         const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f),
00384         const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0;
00385 
00387 
00414     virtual IParticleSphereEmitter* createSphereEmitter(
00415         const core::vector3df& center, f32 radius,
00416         const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
00417         u32 minParticlesPerSecond = 5,
00418         u32 maxParticlesPerSecond = 10,
00419         const video::SColor& minStartColor = video::SColor(255,0,0,0),
00420         const video::SColor& maxStartColor = video::SColor(255,255,255,255),
00421         u32 lifeTimeMin=2000, u32 lifeTimeMax=4000,
00422         s32 maxAngleDegrees=0,
00423         const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f),
00424         const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0;
00425 
00427 
00444     virtual IParticleAttractionAffector* createAttractionAffector(
00445         const core::vector3df& point, f32 speed = 1.0f, bool attract = true,
00446         bool affectX = true, bool affectY = true, bool affectZ = true) = 0;
00447 
00449 
00457     virtual IParticleAffector* createScaleParticleAffector(const core::dimension2df& scaleTo = core::dimension2df(1.0f, 1.0f)) = 0;
00458 
00460 
00472     virtual IParticleFadeOutAffector* createFadeOutParticleAffector(
00473         const video::SColor& targetColor = video::SColor(0,0,0,0),
00474         u32 timeNeededToFadeOut = 1000) = 0;
00475 
00477 
00489     virtual IParticleGravityAffector* createGravityAffector(
00490         const core::vector3df& gravity = core::vector3df(0.0f,-0.03f,0.0f),
00491         u32 timeForceLost = 1000) = 0;
00492 
00494 
00502     virtual IParticleRotationAffector* createRotationAffector(
00503         const core::vector3df& speed = core::vector3df(5.0f,5.0f,5.0f),
00504         const core::vector3df& pivotPoint = core::vector3df(0.0f,0.0f,0.0f) ) = 0;
00505 };
00506 
00507 } // end namespace scene
00508 } // end namespace irr
00509 
00510 
00511 #endif
00512