Nirtcpp 2.1.0
Nirtcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
IParticleSystemSceneNode.hpp
1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in nirtcpp/nirtcpp.hpp
4
5#ifndef NIRT_I_PARTICLE_SYSTEM_SCENE_NODE_HPP_INCLUDED
6#define NIRT_I_PARTICLE_SYSTEM_SCENE_NODE_HPP_INCLUDED
7
8#include <nirtcpp/core/engine/ISceneNode.hpp>
9#include <nirtcpp/core/engine/IParticleAnimatedMeshSceneNodeEmitter.hpp>
10#include <nirtcpp/core/engine/IParticleBoxEmitter.hpp>
11#include <nirtcpp/core/engine/IParticleCylinderEmitter.hpp>
12#include <nirtcpp/core/engine/IParticleMeshEmitter.hpp>
13#include <nirtcpp/core/engine/IParticleRingEmitter.hpp>
14#include <nirtcpp/core/engine/IParticleSphereEmitter.hpp>
15#include <nirtcpp/core/engine/IParticleAttractionAffector.hpp>
16#include <nirtcpp/core/engine/IParticleFadeOutAffector.hpp>
17#include <nirtcpp/core/engine/IParticleGravityAffector.hpp>
18#include <nirtcpp/core/engine/IParticleRotationAffector.hpp>
19#include <nirtcpp/core/engine/dimension2d.hpp>
20
21namespace nirt
22{
23namespace scene
24{
25
27
70
72{
73public:
74
77 const core::vector3df& position = core::vector3df(0,0,0),
78 const core::vector3df& rotation = core::vector3df(0,0,0),
79 const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f))
80 : ISceneNode(parent, mgr, id, position, rotation, scale)
81 , ParticleBehavior(0)
82 {
83 }
84
86 virtual void setParticleSize(
87 const core::dimension2d<f32> &size = core::dimension2d<f32>(5.0f, 5.0f)) = 0;
88
90
93 virtual void setParticlesAreGlobal(bool global=true) = 0;
94
95
97
99 virtual void setParticleBehavior(nirt::u32 flags)
100 {
101 ParticleBehavior = flags;
102 }
103
104
106
109 {
110 return ParticleBehavior;
111 }
112
114 virtual void clearParticles() = 0;
115
117
120 virtual void doParticleSystem(u32 time) = 0;
121
123
125
127
133 virtual void setEmitter(IParticleEmitter* emitter) = 0;
134
136
147 virtual void addAffector(IParticleAffector* affector) = 0;
148
150
152
154 virtual void removeAllAffectors() = 0;
155
157
201 scene::IAnimatedMeshSceneNode* node, bool useNormalDirection = true,
202 const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
203 f32 normalDirectionModifier = 100.0f, s32 mbNumber = -1,
204 bool everyMeshVertex = false,
205 u32 minParticlesPerSecond = 5, u32 maxParticlesPerSecond = 10,
206 const video::SColor& minStartColor = video::SColor(255,0,0,0),
207 const video::SColor& maxStartColor = video::SColor(255,255,255,255),
208 u32 lifeTimeMin = 2000, u32 lifeTimeMax = 4000,
209 s32 maxAngleDegrees = 0,
210 const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f),
211 const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0;
212
214
241 const core::aabbox3df& box = core::aabbox3df(-10,28,-10,10,30,10),
242 const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
243 u32 minParticlesPerSecond = 5,
244 u32 maxParticlesPerSecond = 10,
245 const video::SColor& minStartColor = video::SColor(255,0,0,0),
246 const video::SColor& maxStartColor = video::SColor(255,255,255,255),
247 u32 lifeTimeMin=2000, u32 lifeTimeMax=4000,
248 s32 maxAngleDegrees=0,
249 const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f),
250 const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0;
251
253
285 const core::vector3df& center, f32 radius,
286 const core::vector3df& normal, f32 length,
287 bool outlineOnly = false,
288 const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
289 u32 minParticlesPerSecond = 5, u32 maxParticlesPerSecond = 10,
290 const video::SColor& minStartColor = video::SColor(255,0,0,0),
291 const video::SColor& maxStartColor = video::SColor(255,255,255,255),
292 u32 lifeTimeMin = 2000, u32 lifeTimeMax = 4000,
293 s32 maxAngleDegrees = 0,
294 const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f),
295 const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0;
296
298
341 scene::IMesh* mesh, bool useNormalDirection = true,
342 const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
343 f32 normalDirectionModifier = 100.0f, s32 mbNumber = -1,
344 bool everyMeshVertex = false,
345 u32 minParticlesPerSecond = 5, u32 maxParticlesPerSecond = 10,
346 const video::SColor& minStartColor = video::SColor(255,0,0,0),
347 const video::SColor& maxStartColor = video::SColor(255,255,255,255),
348 u32 lifeTimeMin = 2000, u32 lifeTimeMax = 4000,
349 s32 maxAngleDegrees = 0,
350 const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f),
351 const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0;
352
354
380 const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
381 u32 minParticlesPerSecond = 5,
382 u32 maxParticlesPerSecond = 10,
383 const video::SColor& minStartColor = video::SColor(255,0,0,0),
384 const video::SColor& maxStartColor = video::SColor(255,255,255,255),
385 u32 lifeTimeMin=2000, u32 lifeTimeMax=4000,
386 s32 maxAngleDegrees=0,
387 const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f),
388 const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0;
389
391
422 const core::vector3df& center, f32 radius, f32 ringThickness,
423 const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
424 u32 minParticlesPerSecond = 5,
425 u32 maxParticlesPerSecond = 10,
426 const video::SColor& minStartColor = video::SColor(255,0,0,0),
427 const video::SColor& maxStartColor = video::SColor(255,255,255,255),
428 u32 lifeTimeMin=2000, u32 lifeTimeMax=4000,
429 s32 maxAngleDegrees=0,
430 const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f),
431 const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0;
432
434
462 const core::vector3df& center, f32 radius,
463 const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
464 u32 minParticlesPerSecond = 5,
465 u32 maxParticlesPerSecond = 10,
466 const video::SColor& minStartColor = video::SColor(255,0,0,0),
467 const video::SColor& maxStartColor = video::SColor(255,255,255,255),
468 u32 lifeTimeMin=2000, u32 lifeTimeMax=4000,
469 s32 maxAngleDegrees=0,
470 const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f),
471 const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) ) = 0;
472
474
492 const core::vector3df& point, f32 speed = 1.0f, bool attract = true,
493 bool affectX = true, bool affectY = true, bool affectZ = true) = 0;
494
496
505
507
520 const video::SColor& targetColor = video::SColor(0,0,0,0),
521 u32 timeNeededToFadeOut = 1000) = 0;
522
524
537 const core::vector3df& gravity = core::vector3df(0.0f,-0.03f,0.0f),
538 u32 timeForceLost = 1000) = 0;
539
541
550 const core::vector3df& speed = core::vector3df(5.0f,5.0f,5.0f),
551 const core::vector3df& pivotPoint = core::vector3df(0.0f,0.0f,0.0f) ) = 0;
552
554 virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const override
555 {
556 out->addInt("ParticleBehavior", ParticleBehavior);
557 }
558
561 {
562 ParticleBehavior = in->getAttributeAsInt("ParticleBehavior", ParticleBehavior);
563 }
564
565protected:
566 s32 ParticleBehavior;
567};
568
569} // end namespace scene
570} // end namespace nirt
571
572#endif
Axis aligned bounding box in 3d dimensional space.
Definition aabbox3d.hpp:22
Provides a generic interface for attributes and their values and the possibility to serialize them.
Definition IAttributes.hpp:42
virtual s32 getAttributeAsInt(const c8 *attributeName, nirt::s32 defaultNotFound=0) const =0
virtual void addInt(const c8 *attributeName, s32 value)=0
Adds an attribute as integer.
class holding data describing options
Definition IAttributeExchangingObject.hpp:35
Scene node capable of displaying an animated mesh.
Definition IAnimatedMeshSceneNode.hpp:52
Class which holds the geometry of an object.
Definition IMesh.hpp:72
A particle affector modifies particles.
Definition IParticleAffector.hpp:42
A particle emitter which emits particles from mesh vertices.
Definition IParticleAnimatedMeshSceneNodeEmitter.hpp:18
A particle affector which attracts or detracts particles.
Definition IParticleAttractionAffector.hpp:17
A particle emitter which emits particles from a box shaped space.
Definition IParticleBoxEmitter.hpp:18
A particle emitter which emits from a cylindrically shaped space.
Definition IParticleCylinderEmitter.hpp:17
A particle emitter for using with particle systems.
Definition IParticleEmitter.hpp:46
A particle affector which fades out the particles.
Definition IParticleFadeOutAffector.hpp:17
A particle affector which applies gravity to particles.
Definition IParticleGravityAffector.hpp:17
A particle emitter which emits from vertices of a mesh.
Definition IParticleMeshEmitter.hpp:18
A particle emitter which emits particles along a ring shaped area.
Definition IParticleRingEmitter.hpp:17
A particle affector which rotates the particle system.
Definition IParticleRotationAffector.hpp:17
A particle emitter which emits from a spherical space.
Definition IParticleSphereEmitter.hpp:17
Definition IParticleSystemSceneNode.hpp:72
virtual void setParticlesAreGlobal(bool global=true)=0
Sets if the particles should be global.
virtual IParticleRotationAffector * createRotationAffector(const core::vector3df &speed=core::vector3df(5.0f, 5.0f, 5.0f), const core::vector3df &pivotPoint=core::vector3df(0.0f, 0.0f, 0.0f))=0
Creates a rotation affector.
virtual void doParticleSystem(u32 time)=0
Do manually update the particles.
virtual void setEmitter(IParticleEmitter *emitter)=0
Sets the particle emitter, which creates the particles.
virtual void clearParticles()=0
Remove all currently visible particles.
virtual void deserializeAttributes(io::IAttributes *in, io::SAttributeReadWriteOptions *options) override
Reads attributes of the scene node.
Definition IParticleSystemSceneNode.hpp:560
virtual IParticleSphereEmitter * createSphereEmitter(const core::vector3df &center, f32 radius, const core::vector3df &direction=core::vector3df(0.0f, 0.03f, 0.0f), u32 minParticlesPerSecond=5, u32 maxParticlesPerSecond=10, 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))=0
Creates a sphere particle emitter.
IParticleSystemSceneNode(ISceneNode *parent, ISceneManager *mgr, s32 id, const core::vector3df &position=core::vector3df(0, 0, 0), const core::vector3df &rotation=core::vector3df(0, 0, 0), const core::vector3df &scale=core::vector3df(1.0f, 1.0f, 1.0f))
Constructor.
Definition IParticleSystemSceneNode.hpp:76
virtual IParticlePointEmitter * createPointEmitter(const core::vector3df &direction=core::vector3df(0.0f, 0.03f, 0.0f), u32 minParticlesPerSecond=5, u32 maxParticlesPerSecond=10, 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))=0
Creates a point particle emitter.
virtual void addAffector(IParticleAffector *affector)=0
Adds new particle effector to the particle system.
virtual IParticleRingEmitter * createRingEmitter(const core::vector3df &center, f32 radius, f32 ringThickness, const core::vector3df &direction=core::vector3df(0.0f, 0.03f, 0.0f), u32 minParticlesPerSecond=5, u32 maxParticlesPerSecond=10, 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))=0
Creates a ring particle emitter.
virtual IParticleAffector * createScaleParticleAffector(const core::dimension2df &scaleTo=core::dimension2df(1.0f, 1.0f))=0
Creates a scale particle affector.
virtual void serializeAttributes(io::IAttributes *out, io::SAttributeReadWriteOptions *options) const override
Writes attributes of the scene node.
Definition IParticleSystemSceneNode.hpp:554
virtual nirt::u32 getParticleBehavior() const
Gets how particles behave in different situations.
Definition IParticleSystemSceneNode.hpp:108
virtual IParticleGravityAffector * createGravityAffector(const core::vector3df &gravity=core::vector3df(0.0f,-0.03f, 0.0f), u32 timeForceLost=1000)=0
Creates a gravity affector.
virtual void removeAllAffectors()=0
Removes all particle affectors in the particle system.
virtual IParticleAnimatedMeshSceneNodeEmitter * createAnimatedMeshSceneNodeEmitter(scene::IAnimatedMeshSceneNode *node, bool useNormalDirection=true, const core::vector3df &direction=core::vector3df(0.0f, 0.03f, 0.0f), f32 normalDirectionModifier=100.0f, s32 mbNumber=-1, bool everyMeshVertex=false, u32 minParticlesPerSecond=5, u32 maxParticlesPerSecond=10, 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))=0
Creates a particle emitter for an animated mesh scene node.
virtual IParticleAttractionAffector * createAttractionAffector(const core::vector3df &point, f32 speed=1.0f, bool attract=true, bool affectX=true, bool affectY=true, bool affectZ=true)=0
Creates a point attraction affector.
virtual void setParticleBehavior(nirt::u32 flags)
Bitflags to change the particle behavior.
Definition IParticleSystemSceneNode.hpp:99
virtual const core::list< IParticleAffector * > & getAffectors() const =0
Get a list of all particle affectors.
virtual void setParticleSize(const core::dimension2d< f32 > &size=core::dimension2d< f32 >(5.0f, 5.0f))=0
Sets the size of all particles.
virtual IParticleEmitter * getEmitter()=0
Gets the particle emitter, which creates the particles.
virtual IParticleFadeOutAffector * createFadeOutParticleAffector(const video::SColor &targetColor=video::SColor(0, 0, 0, 0), u32 timeNeededToFadeOut=1000)=0
Creates a fade out particle affector.
virtual IParticleMeshEmitter * createMeshEmitter(scene::IMesh *mesh, bool useNormalDirection=true, const core::vector3df &direction=core::vector3df(0.0f, 0.03f, 0.0f), f32 normalDirectionModifier=100.0f, s32 mbNumber=-1, bool everyMeshVertex=false, u32 minParticlesPerSecond=5, u32 maxParticlesPerSecond=10, 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))=0
Creates a mesh particle emitter.
virtual IParticleCylinderEmitter * createCylinderEmitter(const core::vector3df &center, f32 radius, const core::vector3df &normal, f32 length, bool outlineOnly=false, const core::vector3df &direction=core::vector3df(0.0f, 0.03f, 0.0f), u32 minParticlesPerSecond=5, u32 maxParticlesPerSecond=10, 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))=0
Creates a particle emitter for emitting from a cylinder.
virtual IParticleBoxEmitter * createBoxEmitter(const core::aabbox3df &box=core::aabbox3df(-10, 28,-10, 10, 30, 10), const core::vector3df &direction=core::vector3df(0.0f, 0.03f, 0.0f), u32 minParticlesPerSecond=5, u32 maxParticlesPerSecond=10, 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))=0
Creates a box particle emitter.
The Scene Manager manages scene nodes, mesh resources, cameras and all the other stuff.
Definition ISceneManager.hpp:160
Scene node interface.
Definition ISceneNode.hpp:43
Class representing a 32 bit ARGB color.
Definition SColor.hpp:317
EParticleBehavior
A particle system scene node for creating snow, fire, explosions, smoke...
Definition IParticleSystemSceneNode.hpp:48
@ EPB_INVISIBLE_EMITTING
Continue emitting new particles even when the node is invisible.
Definition IParticleSystemSceneNode.hpp:50
@ EPB_EMITTER_VECTOR_IGNORE_ROTATION
Definition IParticleSystemSceneNode.hpp:63
@ EPB_INVISIBLE_ANIMATING
Continue updating particle positions or deleting them even when the node is invisible.
Definition IParticleSystemSceneNode.hpp:56
@ EPB_EMITTER_FRAME_INTERPOLATION
Definition IParticleSystemSceneNode.hpp:68
@ EPB_INVISIBLE_AFFECTING
Continue affecting particles even when the node is invisible.
Definition IParticleSystemSceneNode.hpp:53
@ EPB_CLEAR_ON_INVISIBLE
Clear all particles when node gets invisible.
Definition IParticleSystemSceneNode.hpp:59
As of Nirtcpp 1.6, position2d is a synonym for vector2d.
Definition vector3d.hpp:11
signed int s32
32 bit signed variable.
Definition irrTypes.hpp:72
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.hpp:64
float f32
32 bit floating point variable.
Definition irrTypes.hpp:110

Nirtcpp    @cppfx.xyz

Esvcpp    esv::print