# OgreParticle.h

Go to the documentation of this file.

    00001 /*
    00002 -----------------------------------------------------------------------------
    00003 This source file is part of OGRE
    00004     (Object-oriented Graphics Rendering Engine)
    00005 For the latest info, see http://www.ogre3d.org/
    00006
    00007 Copyright (c) 2000-2005 The OGRE Team
    00008 Also see acknowledgements in Readme.html
    00009
    00010 This program is free software; you can redistribute it and/or modify it under
    00011 the terms of the GNU Lesser General Public License as published by the Free Software
    00012 Foundation; either version 2 of the License, or (at your option) any later
    00013 version.
    00014
    00015 This program is distributed in the hope that it will be useful, but WITHOUT
    00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
    00018
    00019 You should have received a copy of the GNU Lesser General Public License along with
    00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
    00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
    00022 http://www.gnu.org/copyleft/lesser.txt.
    00023 -----------------------------------------------------------------------------
    00024 */
    00025 #ifndef __Particle_H__
    00026 #define __Particle_H__
    00027
    00028 #include "OgrePrerequisites.h"
    00029 #include "OgreBillboard.h"
    00030
    00031 namespace Ogre {
    00032
    00042     class _OgreExport ParticleVisualData
    00043     {
    00044     public:
    00045         ParticleVisualData() {}
    00046         virtual ~ParticleVisualData() {}
    00047
    00048     };
    00049
    00051     class _OgreExport Particle
    00052     {
    00053     protected:
    00055         ParticleSystem* mParentSystem;
    00057         ParticleVisualData* mVisual;
    00058     public:
    00060         bool mOwnDimensions;
    00062         Real mWidth;
    00064         Real mHeight;
    00066         Radian rotation;
    00067         // Note the intentional public access to internal variables
    00068         // Accessing via get/set would be too costly for 000's of particles
    00070         Vector3 position;
    00072         Vector3 direction;
    00074         ColourValue colour;
    00076         Real timeToLive;
    00078         Real totalTimeToLive;
    00080         Radian rotationSpeed;
    00081
    00082
    00083         Particle()
    00084             : mParentSystem(0), mVisual(0), mOwnDimensions(false), rotation(0),
    00085             position(Vector3::ZERO), direction(Vector3::ZERO),
    00086             colour(ColourValue::White), timeToLive(10), totalTimeToLive(10),
    00087             rotationSpeed(0)
    00088         {
    00089         }
    00090
    00098         void setDimensions(Real width, Real height);
    00099
    00105         bool hasOwnDimensions(void) const { return mOwnDimensions; }
    00106
    00108         Real getOwnWidth(void) const { return mWidth; }
    00109
    00111         Real getOwnHeight(void) const { return mHeight; }
    00112
    00114         void setRotation(const Radian& rad);
    00115
    00116         const Radian& getRotation(void) const { return rotation; }
    00117
    00120         void _notifyOwner(ParticleSystem* owner);
    00121
    00124         void _notifyVisualData(ParticleVisualData* vis) { mVisual = vis; }
    00125
    00127         ParticleVisualData* getVisualData(void) const { return mVisual; }
    00128
    00130         void resetDimensions(void);
    00131
    00132
    00133     };
    00134 }
    00135
    00136 #endif
    00137

Copyright © 2000-2005 by The OGRE Team
Last modified Sun Nov 20 12:36:03 2005