OgreParticle.h
Go to the documentation of this file.
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2013 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------------------------------------------------------------------------
*/
#ifndef __Particle_H__
#define __Particle_H__
#include "OgrePrerequisites.h"
#include "OgreBillboard.h"
#include "OgreHeaderPrefix.h"
namespace Ogre {
class _OgreExport ParticleVisualData : public FXAlloc
{
public:
ParticleVisualData() {}
virtual ~ParticleVisualData() {}
};
class _OgreExport Particle : public FXAlloc
{
protected:
ParticleSystem* mParentSystem;
ParticleVisualData* mVisual;
public:
enum ParticleType
{
Visual,
Emitter
};
bool mOwnDimensions;
Real mWidth;
Real mHeight;
Radian rotation;
// Note the intentional public access to internal variables
// Accessing via get/set would be too costly for 000's of particles
Vector3 position;
Vector3 direction;
ColourValue colour;
Real timeToLive;
Real totalTimeToLive;
Radian rotationSpeed;
ParticleType particleType;
Particle()
: mParentSystem(0), mVisual(0), mOwnDimensions(false), rotation(0),
position(Vector3::ZERO), direction(Vector3::ZERO),
colour(ColourValue::White), timeToLive(10), totalTimeToLive(10),
rotationSpeed(0), particleType(Visual)
{
}
void setDimensions(Real width, Real height);
bool hasOwnDimensions(void) const { return mOwnDimensions; }
Real getOwnWidth(void) const { return mWidth; }
Real getOwnHeight(void) const { return mHeight; }
void setRotation(const Radian& rad);
const Radian& getRotation(void) const { return rotation; }
void _notifyOwner(ParticleSystem* owner);
void _notifyVisualData(ParticleVisualData* vis) { mVisual = vis; }
ParticleVisualData* getVisualData(void) const { return mVisual; }
void resetDimensions(void);
};
}
#include "OgreHeaderSuffix.h"
#endif
Ogre::Particle::mHeight
Real mHeight
Personal height if mOwnDimensions == true.
Definition: OgreParticle.h:81
Ogre::Particle::rotation
Radian rotation
Current rotation value.
Definition: OgreParticle.h:83
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
Ogre::Particle::getOwnHeight
Real getOwnHeight(void) const
Retrieves the particle&#39;s personal width, if hasOwnDimensions is true.
Definition: OgreParticle.h:129
Ogre::Particle::mOwnDimensions
bool mOwnDimensions
Does this particle have it&#39;s own dimensions?
Definition: OgreParticle.h:77
Ogre::ColourValue
Class representing colour.
Definition: OgreColourValue.h:57
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
Ogre::Particle::hasOwnDimensions
bool hasOwnDimensions(void) const
Returns true if this particle deviates from the ParticleSystem&#39;s default dimensions (i...
Definition: OgreParticle.h:123
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
OgrePrerequisites.h
Ogre::ParticleVisualData::ParticleVisualData
ParticleVisualData()
Definition: OgreParticle.h:55
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::ParticleVisualData
Abstract class containing any additional data required to be associated with a particle to perform th...
Definition: OgreParticle.h:52
Ogre::Particle::getVisualData
ParticleVisualData * getVisualData(void) const
Get the optional visual data associated with the class.
Definition: OgreParticle.h:145
OgreHeaderSuffix.h
Ogre::Particle::Visual
Definition: OgreParticle.h:72
Ogre::Particle
Class representing a single particle instance.
Definition: OgreParticle.h:61
Ogre::Particle::position
Vector3 position
World position.
Definition: OgreParticle.h:87
OgreBillboard.h
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::Particle::ParticleType
ParticleType
Type of particle.
Definition: OgreParticle.h:70
Ogre::Particle::direction
Vector3 direction
Direction (and speed)
Definition: OgreParticle.h:89
Ogre::Particle::Particle
Particle()
Definition: OgreParticle.h:101
Ogre::Particle::getOwnWidth
Real getOwnWidth(void) const
Retrieves the particle&#39;s personal width, if hasOwnDimensions is true.
Definition: OgreParticle.h:126
OgreHeaderPrefix.h
Ogre::ParticleVisualData::~ParticleVisualData
virtual ~ParticleVisualData()
Definition: OgreParticle.h:56
Ogre::Particle::totalTimeToLive
Real totalTimeToLive
Total Time to live, number of seconds of particles natural life.
Definition: OgreParticle.h:95
Ogre::ParticleSystem
Class defining particle system based special effects.
Definition: OgreParticleSystem.h:67
Ogre::Particle::_notifyVisualData
void _notifyVisualData(ParticleVisualData *vis)
Internal method for notifying the particle of it&#39;s optional visual data.
Definition: OgreParticle.h:142
Ogre::Particle::getRotation
const Radian & getRotation(void) const
Definition: OgreParticle.h:134
Ogre::Particle::particleType
ParticleType particleType
Determines the type of particle.
Definition: OgreParticle.h:99
Ogre::AllocatedObject
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Definition: OgreMemoryAllocatedObject.h:58
Ogre::Particle::rotationSpeed
Radian rotationSpeed
Speed of rotation in radians/sec.
Definition: OgreParticle.h:97
Ogre::Radian
Wrapper class which indicates a given angle value is in Radians.
Definition: OgreMath.h:47

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.