1 | /*
|
---|
2 | -----------------------------------------------------------------------------
|
---|
3 | This source file is part of OGRE
|
---|
4 | (Object-oriented Graphics Rendering Engine)
|
---|
5 | For the latest info, see http://www.ogre3d.org/
|
---|
6 |
|
---|
7 | Copyright ) 2002 Tels <http://bloodgate.com> based on BoxEmitter
|
---|
8 | Also see acknowledgements in Readme.html
|
---|
9 |
|
---|
10 | This program is free software; you can redistribute it and/or modify it under
|
---|
11 | the terms of the GNU Lesser General Public License as published by the Free Software
|
---|
12 | Foundation; either version 2 of the License, or (at your option) any later
|
---|
13 | version.
|
---|
14 |
|
---|
15 | This program is distributed in the hope that it will be useful, but WITHOUT
|
---|
16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
---|
17 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
---|
18 |
|
---|
19 | You should have received a copy of the GNU Lesser General Public License along with
|
---|
20 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
---|
21 | Place - Suite 330, Boston, MA 02111-1307, USA, or go to
|
---|
22 | http://www.gnu.org/copyleft/lesser.txt.
|
---|
23 | -----------------------------------------------------------------------------
|
---|
24 | */
|
---|
25 | #ifndef __RingEmitter_H__
|
---|
26 | #define __RingEmitter_H__
|
---|
27 |
|
---|
28 | #include "OgreParticleFXPrerequisites.h"
|
---|
29 | #include "OgreAreaEmitter.h"
|
---|
30 | #include "OgreMath.h"
|
---|
31 |
|
---|
32 | namespace Ogre {
|
---|
33 |
|
---|
34 | /** Particle emitter which emits particles randomly from points inside a ring (e.g. a tube).
|
---|
35 | @remarks
|
---|
36 | This particle emitter emits particles from a ring-shaped area.
|
---|
37 | The initial direction of these particles can either be a single
|
---|
38 | direction (i.e. a line), a random scattering inside a cone, or a random
|
---|
39 | scattering in all directions, depending the 'angle' parameter, which
|
---|
40 | is the angle across which to scatter the particles either side of the
|
---|
41 | base direction of the emitter.
|
---|
42 | */
|
---|
43 | class _OgreParticleFXExport RingEmitter : public AreaEmitter
|
---|
44 | {
|
---|
45 | public:
|
---|
46 | // See AreaEmitter
|
---|
47 | /** Command object for inner size (see ParamCommand).*/
|
---|
48 | class CmdInnerX : public ParamCommand
|
---|
49 | {
|
---|
50 | public:
|
---|
51 | String doGet(const void* target) const;
|
---|
52 | void doSet(void* target, const String& val);
|
---|
53 | };
|
---|
54 | /** Command object for inner size (see ParamCommand).*/
|
---|
55 | class CmdInnerY : public ParamCommand
|
---|
56 | {
|
---|
57 | public:
|
---|
58 | String doGet(const void* target) const;
|
---|
59 | void doSet(void* target, const String& val);
|
---|
60 | };
|
---|
61 |
|
---|
62 | RingEmitter(ParticleSystem* psys);
|
---|
63 |
|
---|
64 | /** See ParticleEmitter. */
|
---|
65 | void _initParticle(Particle* pParticle);
|
---|
66 |
|
---|
67 | /** Sets the size of the clear space inside the area from where NO particles are emitted.
|
---|
68 | @param x,y,z
|
---|
69 | Parametric values describing the proportion of the shape which is hollow in each direction.
|
---|
70 | E.g. 0 is solid, 0.5 is half-hollow etc
|
---|
71 | */
|
---|
72 | void setInnerSize(Real x, Real y);
|
---|
73 |
|
---|
74 | /** Sets the x component of the area inside the ellipsoid which doesn't emit particles.
|
---|
75 | @param x
|
---|
76 | Parametric value describing the proportion of the shape which is hollow in this direction.
|
---|
77 | E.g. 0 is solid, 0.5 is half-hollow etc
|
---|
78 | */
|
---|
79 | void setInnerSizeX(Real x);
|
---|
80 | /** Sets the y component of the area inside the ellipsoid which doesn't emit particles.
|
---|
81 | @param y
|
---|
82 | Parametric value describing the proportion of the shape which is hollow in this direction.
|
---|
83 | E.g. 0 is solid, 0.5 is half-hollow etc
|
---|
84 | */
|
---|
85 | void setInnerSizeY(Real y);
|
---|
86 | /** Gets the x component of the area inside the ellipsoid which doesn't emit particles. */
|
---|
87 | Real getInnerSizeX(void) const;
|
---|
88 | /** Gets the y component of the area inside the ellipsoid which doesn't emit particles. */
|
---|
89 | Real getInnerSizeY(void) const;
|
---|
90 |
|
---|
91 | protected:
|
---|
92 | // See ParticleEmitter
|
---|
93 | static CmdInnerX msCmdInnerX;
|
---|
94 | static CmdInnerY msCmdInnerY;
|
---|
95 |
|
---|
96 | /// Size of 'clear' center area (> 0 and < 1.0)
|
---|
97 | Real mInnerSizex;
|
---|
98 | Real mInnerSizey;
|
---|
99 |
|
---|
100 |
|
---|
101 |
|
---|
102 | };
|
---|
103 |
|
---|
104 | }
|
---|
105 |
|
---|
106 | #endif
|
---|
107 |
|
---|