OGRE  1.8
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreParticle.h
Go to the documentation of this file.
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 (c) 2000-2013 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 #ifndef __Particle_H__
29 #define __Particle_H__
30 
31 #include "OgrePrerequisites.h"
32 #include "OgreBillboard.h"
33 #include "OgreHeaderPrefix.h"
34 
35 namespace Ogre {
36 
53  {
54  public:
56  virtual ~ParticleVisualData() {}
57 
58  };
59 
61  class _OgreExport Particle : public FXAlloc
62  {
63  protected:
68  public:
71  {
73  Emitter
74  };
75 
84  // Note the intentional public access to internal variables
85  // Accessing via get/set would be too costly for 000's of particles
100 
102  : mParentSystem(0), mVisual(0), mOwnDimensions(false), rotation(0),
103  position(Vector3::ZERO), direction(Vector3::ZERO),
104  colour(ColourValue::White), timeToLive(10), totalTimeToLive(10),
105  rotationSpeed(0), particleType(Visual)
106  {
107  }
108 
116  void setDimensions(Real width, Real height);
117 
123  bool hasOwnDimensions(void) const { return mOwnDimensions; }
124 
126  Real getOwnWidth(void) const { return mWidth; }
127 
129  Real getOwnHeight(void) const { return mHeight; }
130 
132  void setRotation(const Radian& rad);
133 
134  const Radian& getRotation(void) const { return rotation; }
135 
138  void _notifyOwner(ParticleSystem* owner);
139 
142  void _notifyVisualData(ParticleVisualData* vis) { mVisual = vis; }
143 
145  ParticleVisualData* getVisualData(void) const { return mVisual; }
146 
148  void resetDimensions(void);
149  };
152 }
153 
154 #include "OgreHeaderSuffix.h"
155 
156 #endif
157 
bool hasOwnDimensions(void) const
Returns true if this particle deviates from the ParticleSystem's default dimensions (i...
Definition: OgreParticle.h:123
Real getOwnHeight(void) const
Retrieves the particle's personal width, if hasOwnDimensions is true.
Definition: OgreParticle.h:129
ParticleType particleType
Determines the type of particle.
Definition: OgreParticle.h:99
Class defining particle system based special effects.
Real mHeight
Personal height if mOwnDimensions == true.
Definition: OgreParticle.h:81
float Real
Software floating point type.
#define _OgreExport
Definition: OgrePlatform.h:233
void _notifyVisualData(ParticleVisualData *vis)
Internal method for notifying the particle of it's optional visual data.
Definition: OgreParticle.h:142
Real timeToLive
Time to live, number of seconds left of particles natural life.
Definition: OgreParticle.h:93
Class representing colour.
Radian rotation
Current rotation value.
Definition: OgreParticle.h:83
Vector3 direction
Direction (and speed)
Definition: OgreParticle.h:89
ParticleSystem * mParentSystem
Parent ParticleSystem.
Definition: OgreParticle.h:65
Class representing a single particle instance.
Definition: OgreParticle.h:61
ParticleVisualData * getVisualData(void) const
Get the optional visual data associated with the class.
Definition: OgreParticle.h:145
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
ColourValue colour
Current colour.
Definition: OgreParticle.h:91
Standard 3-dimensional vector.
Definition: OgreVector3.h:51
Vector3 position
World position.
Definition: OgreParticle.h:87
const Radian & getRotation(void) const
Definition: OgreParticle.h:134
Wrapper class which indicates a given angle value is in Radians.
Definition: OgreMath.h:46
Real getOwnWidth(void) const
Retrieves the particle's personal width, if hasOwnDimensions is true.
Definition: OgreParticle.h:126
Radian rotationSpeed
Speed of rotation in radians/sec.
Definition: OgreParticle.h:97
Real mWidth
Personal width if mOwnDimensions == true.
Definition: OgreParticle.h:79
bool mOwnDimensions
Does this particle have it's own dimensions?
Definition: OgreParticle.h:77
ParticleType
Type of particle.
Definition: OgreParticle.h:70
Abstract class containing any additional data required to be associated with a particle to perform th...
Definition: OgreParticle.h:52
ParticleVisualData * mVisual
Additional visual data you might want to associate with the Particle.
Definition: OgreParticle.h:67
Real totalTimeToLive
Total Time to live, number of seconds of particles natural life.
Definition: OgreParticle.h:95