OGRE  1.9.0
OgreParticle.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4(Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2014 Torus Knot Software Ltd
8
9Permission is hereby granted, free of charge, to any person obtaining a copy
10of this software and associated documentation files (the "Software"), to deal
11in the Software without restriction, including without limitation the rights
12to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13copies of the Software, and to permit persons to whom the Software is
14furnished to do so, subject to the following conditions:
15
16The above copyright notice and this permission notice shall be included in
17all copies or substantial portions of the Software.
18
19THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25THE 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
35namespace Ogre {
36
53 {
54 public:
57
58 };
59
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
139
143
145 ParticleVisualData* getVisualData(void) const { return mVisual; }
146
148 void resetDimensions(void);
149 };
152}
153
154#include "OgreHeaderSuffix.h"
155
156#endif
157
#define _OgreExport
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Class representing colour.
Class defining particle system based special effects.
Abstract class containing any additional data required to be associated with a particle to perform th...
Class representing a single particle instance.
Real timeToLive
Time to live, number of seconds left of particles natural life.
ParticleType particleType
Determines the type of particle.
ParticleType
Type of particle.
Radian rotation
Current rotation value.
Vector3 position
World position.
ParticleVisualData * getVisualData(void) const
Get the optional visual data associated with the class.
void resetDimensions(void)
Utility method to reset this particle.
Real totalTimeToLive
Total Time to live, number of seconds of particles natural life.
void _notifyOwner(ParticleSystem *owner)
Internal method for notifying the particle of it's owner.
ParticleVisualData * mVisual
Additional visual data you might want to associate with the Particle.
void setDimensions(Real width, Real height)
Sets the width and height for this particle.
Radian rotationSpeed
Speed of rotation in radians/sec.
Real getOwnHeight(void) const
Retrieves the particle's personal width, if hasOwnDimensions is true.
Real mHeight
Personal height if mOwnDimensions == true.
ParticleSystem * mParentSystem
Parent ParticleSystem.
void setRotation(const Radian &rad)
Sets the current rotation.
bool mOwnDimensions
Does this particle have it's own dimensions?
const Radian & getRotation(void) const
Vector3 direction
Direction (and speed)
void _notifyVisualData(ParticleVisualData *vis)
Internal method for notifying the particle of it's optional visual data.
Real mWidth
Personal width if mOwnDimensions == true.
Real getOwnWidth(void) const
Retrieves the particle's personal width, if hasOwnDimensions is true.
ColourValue colour
Current colour.
bool hasOwnDimensions(void) const
Returns true if this particle deviates from the ParticleSystem's default dimensions (i....
Wrapper class which indicates a given angle value is in Radians.
Definition OgreMath.h:48
Reference-counted shared pointer, used for objects where implicit destruction is required.
Standard 3-dimensional vector.
Definition OgreVector3.h:52