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 
52  class _OgreExport ParticleVisualData : public FXAlloc
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 
OgreHeaderSuffix.h
OgreBillboard.h
Ogre::Particle::timeToLive
Real timeToLive
Time to live, number of seconds left of particles natural life.
Definition: OgreParticle.h:93
Ogre::Particle::mVisual
ParticleVisualData * mVisual
Additional visual data you might want to associate with the Particle.
Definition: OgreParticle.h:67
Ogre::Particle::getVisualData
ParticleVisualData * getVisualData(void) const
Get the optional visual data associated with the class.
Definition: OgreParticle.h:145
Ogre::AllocatedObject
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Definition: OgreMemoryAllocatedObject.h:58
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::ParticleVisualData
Abstract class containing any additional data required to be associated with a particle to perform th...
Definition: OgreParticle.h:52
Ogre::Particle::position
Vector3 position
World position.
Definition: OgreParticle.h:87
Ogre::Particle::direction
Vector3 direction
Direction (and speed)
Definition: OgreParticle.h:89
Ogre::Particle::getOwnWidth
Real getOwnWidth(void) const
Retrieves the particle's personal width, if hasOwnDimensions is true.
Definition: OgreParticle.h:126
Ogre::ParticleVisualData::~ParticleVisualData
virtual ~ParticleVisualData()
Definition: OgreParticle.h:56
Ogre::Particle::ParticleType
ParticleType
Type of particle.
Definition: OgreParticle.h:70
Ogre::Particle::totalTimeToLive
Real totalTimeToLive
Total Time to live, number of seconds of particles natural life.
Definition: OgreParticle.h:95
Ogre::Particle::getRotation
const Radian & getRotation(void) const
Definition: OgreParticle.h:134
Ogre::Particle::Particle
Particle()
Definition: OgreParticle.h:101
Ogre::Particle::rotationSpeed
Radian rotationSpeed
Speed of rotation in radians/sec.
Definition: OgreParticle.h:97
Ogre::Particle::_notifyVisualData
void _notifyVisualData(ParticleVisualData *vis)
Internal method for notifying the particle of it's optional visual data.
Definition: OgreParticle.h:142
OgreHeaderPrefix.h
Ogre::Particle::particleType
ParticleType particleType
Determines the type of particle.
Definition: OgreParticle.h:99
Ogre::Particle::mHeight
Real mHeight
Personal height if mOwnDimensions == true.
Definition: OgreParticle.h:81
Ogre::ParticleVisualData::ParticleVisualData
ParticleVisualData()
Definition: OgreParticle.h:55
OgrePrerequisites.h
Ogre::Radian
Wrapper class which indicates a given angle value is in Radians.
Definition: OgreMath.h:47
Ogre::Particle::rotation
Radian rotation
Current rotation value.
Definition: OgreParticle.h:83
Ogre::Particle
Class representing a single particle instance.
Definition: OgreParticle.h:61
Ogre::Particle::getOwnHeight
Real getOwnHeight(void) const
Retrieves the particle's personal width, if hasOwnDimensions is true.
Definition: OgreParticle.h:129
Ogre::ColourValue
Class representing colour.
Definition: OgreColourValue.h:57
Ogre::Particle::hasOwnDimensions
bool hasOwnDimensions(void) const
Returns true if this particle deviates from the ParticleSystem's default dimensions (i....
Definition: OgreParticle.h:123
Ogre::Particle::Visual
@ Visual
Definition: OgreParticle.h:72
Ogre::Particle::mOwnDimensions
bool mOwnDimensions
Does this particle have it's own dimensions?
Definition: OgreParticle.h:77
Ogre::ParticleSystem
Class defining particle system based special effects.
Definition: OgreParticleSystem.h:67
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
Ogre::Particle::mParentSystem
ParticleSystem * mParentSystem
Parent ParticleSystem.
Definition: OgreParticle.h:65
Ogre::Particle::colour
ColourValue colour
Current colour.
Definition: OgreParticle.h:91
Ogre::Vector3
Standard 3-dimensional vector.
Definition: OgreVector3.h:51
Ogre::Particle::mWidth
Real mWidth
Personal width if mOwnDimensions == true.
Definition: OgreParticle.h:79

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Tue Apr 13 2021 08:53:15