diff options
Diffstat (limited to 'libraries/irrlicht-1.8/source/Irrlicht/CParticleAnimatedMeshSceneNodeEmitter.h')
-rw-r--r-- | libraries/irrlicht-1.8/source/Irrlicht/CParticleAnimatedMeshSceneNodeEmitter.h | 322 |
1 files changed, 161 insertions, 161 deletions
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/CParticleAnimatedMeshSceneNodeEmitter.h b/libraries/irrlicht-1.8/source/Irrlicht/CParticleAnimatedMeshSceneNodeEmitter.h index 7ca573d..e42202e 100644 --- a/libraries/irrlicht-1.8/source/Irrlicht/CParticleAnimatedMeshSceneNodeEmitter.h +++ b/libraries/irrlicht-1.8/source/Irrlicht/CParticleAnimatedMeshSceneNodeEmitter.h | |||
@@ -1,161 +1,161 @@ | |||
1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt | 1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt |
2 | // This file is part of the "Irrlicht Engine". | 2 | // This file is part of the "Irrlicht Engine". |
3 | // For conditions of distribution and use, see copyright notice in irrlicht.h | 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h |
4 | 4 | ||
5 | #ifndef __C_PARTICLE_ANIMATED_MESH_SCENE_NODE_EMITTER_H_INCLUDED__ | 5 | #ifndef __C_PARTICLE_ANIMATED_MESH_SCENE_NODE_EMITTER_H_INCLUDED__ |
6 | #define __C_PARTICLE_ANIMATED_MESH_SCENE_NODE_EMITTER_H_INCLUDED__ | 6 | #define __C_PARTICLE_ANIMATED_MESH_SCENE_NODE_EMITTER_H_INCLUDED__ |
7 | 7 | ||
8 | #include "IParticleAnimatedMeshSceneNodeEmitter.h" | 8 | #include "IParticleAnimatedMeshSceneNodeEmitter.h" |
9 | #include "irrArray.h" | 9 | #include "irrArray.h" |
10 | 10 | ||
11 | namespace irr | 11 | namespace irr |
12 | { | 12 | { |
13 | namespace scene | 13 | namespace scene |
14 | { | 14 | { |
15 | 15 | ||
16 | //! An animated mesh emitter | 16 | //! An animated mesh emitter |
17 | class CParticleAnimatedMeshSceneNodeEmitter : public IParticleAnimatedMeshSceneNodeEmitter | 17 | class CParticleAnimatedMeshSceneNodeEmitter : public IParticleAnimatedMeshSceneNodeEmitter |
18 | { | 18 | { |
19 | public: | 19 | public: |
20 | 20 | ||
21 | //! constructor | 21 | //! constructor |
22 | CParticleAnimatedMeshSceneNodeEmitter( | 22 | CParticleAnimatedMeshSceneNodeEmitter( |
23 | IAnimatedMeshSceneNode* node, | 23 | IAnimatedMeshSceneNode* node, |
24 | bool useNormalDirection = true, | 24 | bool useNormalDirection = true, |
25 | const core::vector3df& direction = core::vector3df(0.0f,0.0f,-1.0f), | 25 | const core::vector3df& direction = core::vector3df(0.0f,0.0f,-1.0f), |
26 | f32 normalDirectionModifier = 100.0f, | 26 | f32 normalDirectionModifier = 100.0f, |
27 | s32 mbNumber = -1, | 27 | s32 mbNumber = -1, |
28 | bool everyMeshVertex = false, | 28 | bool everyMeshVertex = false, |
29 | u32 minParticlesPerSecond = 20, | 29 | u32 minParticlesPerSecond = 20, |
30 | u32 maxParticlesPerSecond = 40, | 30 | u32 maxParticlesPerSecond = 40, |
31 | const video::SColor& minStartColor = video::SColor(255,0,0,0), | 31 | const video::SColor& minStartColor = video::SColor(255,0,0,0), |
32 | const video::SColor& maxStartColor = video::SColor(255,255,255,255), | 32 | const video::SColor& maxStartColor = video::SColor(255,255,255,255), |
33 | u32 lifeTimeMin = 2000, | 33 | u32 lifeTimeMin = 2000, |
34 | u32 lifeTimeMax = 4000, | 34 | u32 lifeTimeMax = 4000, |
35 | s32 maxAngleDegrees = 0, | 35 | s32 maxAngleDegrees = 0, |
36 | const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), | 36 | const core::dimension2df& minStartSize = core::dimension2df(5.0f,5.0f), |
37 | const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) | 37 | const core::dimension2df& maxStartSize = core::dimension2df(5.0f,5.0f) |
38 | ); | 38 | ); |
39 | 39 | ||
40 | //! Prepares an array with new particles to emitt into the system | 40 | //! Prepares an array with new particles to emitt into the system |
41 | //! and returns how much new particles there are. | 41 | //! and returns how much new particles there are. |
42 | virtual s32 emitt(u32 now, u32 timeSinceLastCall, SParticle*& outArray); | 42 | virtual s32 emitt(u32 now, u32 timeSinceLastCall, SParticle*& outArray); |
43 | 43 | ||
44 | //! Set Mesh to emit particles from | 44 | //! Set Mesh to emit particles from |
45 | virtual void setAnimatedMeshSceneNode( IAnimatedMeshSceneNode* node ); | 45 | virtual void setAnimatedMeshSceneNode( IAnimatedMeshSceneNode* node ); |
46 | 46 | ||
47 | //! Set whether to use vertex normal for direction, or direction specified | 47 | //! Set whether to use vertex normal for direction, or direction specified |
48 | virtual void setUseNormalDirection( bool useNormalDirection ) { UseNormalDirection = useNormalDirection; } | 48 | virtual void setUseNormalDirection( bool useNormalDirection ) { UseNormalDirection = useNormalDirection; } |
49 | 49 | ||
50 | //! Set direction the emitter emits particles | 50 | //! Set direction the emitter emits particles |
51 | virtual void setDirection( const core::vector3df& newDirection ) { Direction = newDirection; } | 51 | virtual void setDirection( const core::vector3df& newDirection ) { Direction = newDirection; } |
52 | 52 | ||
53 | //! Set the amount that the normal is divided by for getting a particles direction | 53 | //! Set the amount that the normal is divided by for getting a particles direction |
54 | virtual void setNormalDirectionModifier( f32 normalDirectionModifier ) { NormalDirectionModifier = normalDirectionModifier; } | 54 | virtual void setNormalDirectionModifier( f32 normalDirectionModifier ) { NormalDirectionModifier = normalDirectionModifier; } |
55 | 55 | ||
56 | //! Sets whether to emit min<->max particles for every vertex per second, or to pick | 56 | //! Sets whether to emit min<->max particles for every vertex per second, or to pick |
57 | //! min<->max vertices every second | 57 | //! min<->max vertices every second |
58 | virtual void setEveryMeshVertex( bool everyMeshVertex ) { EveryMeshVertex = everyMeshVertex; } | 58 | virtual void setEveryMeshVertex( bool everyMeshVertex ) { EveryMeshVertex = everyMeshVertex; } |
59 | 59 | ||
60 | //! Set minimum number of particles the emitter emits per second | 60 | //! Set minimum number of particles the emitter emits per second |
61 | virtual void setMinParticlesPerSecond( u32 minPPS ) { MinParticlesPerSecond = minPPS; } | 61 | virtual void setMinParticlesPerSecond( u32 minPPS ) { MinParticlesPerSecond = minPPS; } |
62 | 62 | ||
63 | //! Set maximum number of particles the emitter emits per second | 63 | //! Set maximum number of particles the emitter emits per second |
64 | virtual void setMaxParticlesPerSecond( u32 maxPPS ) { MaxParticlesPerSecond = maxPPS; } | 64 | virtual void setMaxParticlesPerSecond( u32 maxPPS ) { MaxParticlesPerSecond = maxPPS; } |
65 | 65 | ||
66 | //! Set minimum starting color for particles | 66 | //! Set minimum starting color for particles |
67 | virtual void setMinStartColor( const video::SColor& color ) { MinStartColor = color; } | 67 | virtual void setMinStartColor( const video::SColor& color ) { MinStartColor = color; } |
68 | 68 | ||
69 | //! Set maximum starting color for particles | 69 | //! Set maximum starting color for particles |
70 | virtual void setMaxStartColor( const video::SColor& color ) { MaxStartColor = color; } | 70 | virtual void setMaxStartColor( const video::SColor& color ) { MaxStartColor = color; } |
71 | 71 | ||
72 | //! Set the maximum starting size for particles | 72 | //! Set the maximum starting size for particles |
73 | virtual void setMaxStartSize( const core::dimension2df& size ) { MaxStartSize = size; } | 73 | virtual void setMaxStartSize( const core::dimension2df& size ) { MaxStartSize = size; } |
74 | 74 | ||
75 | //! Set the minimum starting size for particles | 75 | //! Set the minimum starting size for particles |
76 | virtual void setMinStartSize( const core::dimension2df& size ) { MinStartSize = size; } | 76 | virtual void setMinStartSize( const core::dimension2df& size ) { MinStartSize = size; } |
77 | 77 | ||
78 | //! Set the minimum particle life-time in milliseconds | 78 | //! Set the minimum particle life-time in milliseconds |
79 | virtual void setMinLifeTime( u32 lifeTimeMin ) { MinLifeTime = lifeTimeMin; } | 79 | virtual void setMinLifeTime( u32 lifeTimeMin ) { MinLifeTime = lifeTimeMin; } |
80 | 80 | ||
81 | //! Set the maximum particle life-time in milliseconds | 81 | //! Set the maximum particle life-time in milliseconds |
82 | virtual void setMaxLifeTime( u32 lifeTimeMax ) { MaxLifeTime = lifeTimeMax; } | 82 | virtual void setMaxLifeTime( u32 lifeTimeMax ) { MaxLifeTime = lifeTimeMax; } |
83 | 83 | ||
84 | //! Maximal random derivation from the direction | 84 | //! Maximal random derivation from the direction |
85 | virtual void setMaxAngleDegrees( s32 maxAngleDegrees ) { MaxAngleDegrees = maxAngleDegrees; } | 85 | virtual void setMaxAngleDegrees( s32 maxAngleDegrees ) { MaxAngleDegrees = maxAngleDegrees; } |
86 | 86 | ||
87 | //! Get Mesh we're emitting particles from | 87 | //! Get Mesh we're emitting particles from |
88 | virtual const IAnimatedMeshSceneNode* getAnimatedMeshSceneNode() const { return Node; } | 88 | virtual const IAnimatedMeshSceneNode* getAnimatedMeshSceneNode() const { return Node; } |
89 | 89 | ||
90 | //! Get whether to use vertex normal for direciton, or direction specified | 90 | //! Get whether to use vertex normal for direciton, or direction specified |
91 | virtual bool isUsingNormalDirection() const { return UseNormalDirection; } | 91 | virtual bool isUsingNormalDirection() const { return UseNormalDirection; } |
92 | 92 | ||
93 | //! Get direction the emitter emits particles | 93 | //! Get direction the emitter emits particles |
94 | virtual const core::vector3df& getDirection() const { return Direction; } | 94 | virtual const core::vector3df& getDirection() const { return Direction; } |
95 | 95 | ||
96 | //! Get the amount that the normal is divided by for getting a particles direction | 96 | //! Get the amount that the normal is divided by for getting a particles direction |
97 | virtual f32 getNormalDirectionModifier() const { return NormalDirectionModifier; } | 97 | virtual f32 getNormalDirectionModifier() const { return NormalDirectionModifier; } |
98 | 98 | ||
99 | //! Gets whether to emit min<->max particles for every vertex per second, or to pick | 99 | //! Gets whether to emit min<->max particles for every vertex per second, or to pick |
100 | //! min<->max vertices every second | 100 | //! min<->max vertices every second |
101 | virtual bool getEveryMeshVertex() const { return EveryMeshVertex; } | 101 | virtual bool getEveryMeshVertex() const { return EveryMeshVertex; } |
102 | 102 | ||
103 | //! Get the minimum number of particles the emitter emits per second | 103 | //! Get the minimum number of particles the emitter emits per second |
104 | virtual u32 getMinParticlesPerSecond() const { return MinParticlesPerSecond; } | 104 | virtual u32 getMinParticlesPerSecond() const { return MinParticlesPerSecond; } |
105 | 105 | ||
106 | //! Get the maximum number of particles the emitter emits per second | 106 | //! Get the maximum number of particles the emitter emits per second |
107 | virtual u32 getMaxParticlesPerSecond() const { return MaxParticlesPerSecond; } | 107 | virtual u32 getMaxParticlesPerSecond() const { return MaxParticlesPerSecond; } |
108 | 108 | ||
109 | //! Get the minimum starting color for particles | 109 | //! Get the minimum starting color for particles |
110 | virtual const video::SColor& getMinStartColor() const { return MinStartColor; } | 110 | virtual const video::SColor& getMinStartColor() const { return MinStartColor; } |
111 | 111 | ||
112 | //! Get the maximum starting color for particles | 112 | //! Get the maximum starting color for particles |
113 | virtual const video::SColor& getMaxStartColor() const { return MaxStartColor; } | 113 | virtual const video::SColor& getMaxStartColor() const { return MaxStartColor; } |
114 | 114 | ||
115 | //! Get the maximum starting size for particles | 115 | //! Get the maximum starting size for particles |
116 | virtual const core::dimension2df& getMaxStartSize() const { return MaxStartSize; } | 116 | virtual const core::dimension2df& getMaxStartSize() const { return MaxStartSize; } |
117 | 117 | ||
118 | //! Get the minimum starting size for particles | 118 | //! Get the minimum starting size for particles |
119 | virtual const core::dimension2df& getMinStartSize() const { return MinStartSize; } | 119 | virtual const core::dimension2df& getMinStartSize() const { return MinStartSize; } |
120 | 120 | ||
121 | //! Get the minimum particle life-time in milliseconds | 121 | //! Get the minimum particle life-time in milliseconds |
122 | virtual u32 getMinLifeTime() const { return MinLifeTime; } | 122 | virtual u32 getMinLifeTime() const { return MinLifeTime; } |
123 | 123 | ||
124 | //! Get the maximum particle life-time in milliseconds | 124 | //! Get the maximum particle life-time in milliseconds |
125 | virtual u32 getMaxLifeTime() const { return MaxLifeTime; } | 125 | virtual u32 getMaxLifeTime() const { return MaxLifeTime; } |
126 | 126 | ||
127 | //! Maximal random derivation from the direction | 127 | //! Maximal random derivation from the direction |
128 | virtual s32 getMaxAngleDegrees() const { return MaxAngleDegrees; } | 128 | virtual s32 getMaxAngleDegrees() const { return MaxAngleDegrees; } |
129 | 129 | ||
130 | private: | 130 | private: |
131 | 131 | ||
132 | IAnimatedMeshSceneNode* Node; | 132 | IAnimatedMeshSceneNode* Node; |
133 | IAnimatedMesh* AnimatedMesh; | 133 | IAnimatedMesh* AnimatedMesh; |
134 | const IMesh* BaseMesh; | 134 | const IMesh* BaseMesh; |
135 | s32 TotalVertices; | 135 | s32 TotalVertices; |
136 | u32 MBCount; | 136 | u32 MBCount; |
137 | s32 MBNumber; | 137 | s32 MBNumber; |
138 | core::array<s32> VertexPerMeshBufferList; | 138 | core::array<s32> VertexPerMeshBufferList; |
139 | 139 | ||
140 | core::array<SParticle> Particles; | 140 | core::array<SParticle> Particles; |
141 | core::vector3df Direction; | 141 | core::vector3df Direction; |
142 | f32 NormalDirectionModifier; | 142 | f32 NormalDirectionModifier; |
143 | u32 MinParticlesPerSecond, MaxParticlesPerSecond; | 143 | u32 MinParticlesPerSecond, MaxParticlesPerSecond; |
144 | video::SColor MinStartColor, MaxStartColor; | 144 | video::SColor MinStartColor, MaxStartColor; |
145 | u32 MinLifeTime, MaxLifeTime; | 145 | u32 MinLifeTime, MaxLifeTime; |
146 | core::dimension2df MaxStartSize, MinStartSize; | 146 | core::dimension2df MaxStartSize, MinStartSize; |
147 | 147 | ||
148 | u32 Time; | 148 | u32 Time; |
149 | u32 Emitted; | 149 | u32 Emitted; |
150 | s32 MaxAngleDegrees; | 150 | s32 MaxAngleDegrees; |
151 | 151 | ||
152 | bool EveryMeshVertex; | 152 | bool EveryMeshVertex; |
153 | bool UseNormalDirection; | 153 | bool UseNormalDirection; |
154 | }; | 154 | }; |
155 | 155 | ||
156 | } // end namespace scene | 156 | } // end namespace scene |
157 | } // end namespace irr | 157 | } // end namespace irr |
158 | 158 | ||
159 | 159 | ||
160 | #endif // __C_PARTICLE_ANIMATED_MESH_SCENE_NODE_EMITTER_H_INCLUDED__ | 160 | #endif // __C_PARTICLE_ANIMATED_MESH_SCENE_NODE_EMITTER_H_INCLUDED__ |
161 | 161 | ||