OGRE  2.0
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-2014 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 "OgreHeaderPrefix.h"
33 
34 namespace Ogre {
35 
52  {
53  public:
55  virtual ~ParticleVisualData() {}
56 
57  };
58 
60  class _OgreExport Particle : public FXAlloc
61  {
62  protected:
67  public:
70  {
72  Emitter
73  };
74 
83  // Note the intentional public access to internal variables
84  // Accessing via get/set would be too costly for 000's of particles
99 
101  : mParentSystem(0), mVisual(0), mOwnDimensions(false), mWidth(0), mHeight(0),
102  mRotation(0), mPosition(Vector3::ZERO), mDirection(Vector3::ZERO),
103  mColour(ColourValue::White), mTimeToLive(10), mTotalTimeToLive(10),
104  mRotationSpeed(0), mParticleType(Visual)
105  {
106  }
107 
115  void setDimensions(Real width, Real height);
116 
122  bool hasOwnDimensions(void) const { return mOwnDimensions; }
123 
125  Real getOwnWidth(void) const { return mWidth; }
126 
128  Real getOwnHeight(void) const { return mHeight; }
129 
131  void setRotation(const Radian& rad);
132 
133  const Radian& getRotation(void) const { return mRotation; }
134 
137  void _notifyOwner(ParticleSystem* owner);
138 
141  void _notifyVisualData(ParticleVisualData* vis) { mVisual = vis; }
142 
144  ParticleVisualData* getVisualData(void) const { return mVisual; }
145 
147  void resetDimensions(void);
148  };
151 }
152 
153 #include "OgreHeaderSuffix.h"
154 
155 #endif
156 
bool hasOwnDimensions(void) const
Returns true if this particle deviates from the ParticleSystem's default dimensions (i...
Definition: OgreParticle.h:122
Real getOwnHeight(void) const
Retrieves the particle's personal width, if hasOwnDimensions is true.
Definition: OgreParticle.h:128
Class defining particle system based special effects.
Real mHeight
Personal height if mOwnDimensions == true.
Definition: OgreParticle.h:80
float Real
Software floating point type.
#define _OgreExport
Definition: OgrePlatform.h:255
void _notifyVisualData(ParticleVisualData *vis)
Internal method for notifying the particle of it's optional visual data.
Definition: OgreParticle.h:141
Class representing colour.
Real mTimeToLive
Time to live, number of seconds left of particles natural life.
Definition: OgreParticle.h:92
ParticleType mParticleType
Determines the type of particle.
Definition: OgreParticle.h:98
ColourValue mColour
Current colour.
Definition: OgreParticle.h:90
Vector3 mDirection
Direction (and speed)
Definition: OgreParticle.h:88
Vector3 mPosition
World position.
Definition: OgreParticle.h:86
ParticleSystem * mParentSystem
Parent ParticleSystem.
Definition: OgreParticle.h:64
Class representing a single particle instance.
Definition: OgreParticle.h:60
ParticleVisualData * getVisualData(void) const
Get the optional visual data associated with the class.
Definition: OgreParticle.h:144
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Real mTotalTimeToLive
Total Time to live, number of seconds of particles natural life.
Definition: OgreParticle.h:94
Standard 3-dimensional vector.
Definition: OgreVector3.h:50
const Radian & getRotation(void) const
Definition: OgreParticle.h:133
Wrapper class which indicates a given angle value is in Radians.
Definition: OgreMath.h:49
Radian mRotation
Current rotation value.
Definition: OgreParticle.h:82
Radian mRotationSpeed
Speed of rotation in radians/sec.
Definition: OgreParticle.h:96
Real getOwnWidth(void) const
Retrieves the particle's personal width, if hasOwnDimensions is true.
Definition: OgreParticle.h:125
Real mWidth
Personal width if mOwnDimensions == true.
Definition: OgreParticle.h:78
bool mOwnDimensions
Does this particle have it's own dimensions?
Definition: OgreParticle.h:76
ParticleType
Type of particle.
Definition: OgreParticle.h:69
Abstract class containing any additional data required to be associated with a particle to perform th...
Definition: OgreParticle.h:51
ParticleVisualData * mVisual
Additional visual data you might want to associate with the Particle.
Definition: OgreParticle.h:66