Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

OgreMovableObject.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 © 2000-2002 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 
00026 #ifndef __MovableObject_H__
00027 #define __MovableObject_H__
00028 
00029 // Precompiler options
00030 #include "OgrePrerequisites.h"
00031 #include "OgreRenderQueue.h"
00032 #include "OgreAxisAlignedBox.h"
00033 #include "OgreSphere.h"
00034 #include "OgreShadowCaster.h"
00035 
00036 namespace Ogre {
00037 
00038 
00044     class _OgreExport MovableObject : public ShadowCaster
00045     {
00046     protected:
00048         Node* mParentNode;
00049         bool mParentIsTagPoint;
00051         bool mVisible;
00053         UserDefinedObject *mUserObject;
00055         RenderQueueGroupID mRenderQueueID;
00057         unsigned long mQueryFlags;
00059         mutable AxisAlignedBox mWorldAABB;
00060         // Cached world bounding sphere
00061         mutable Sphere mWorldBoundingSphere;
00063         mutable AxisAlignedBox mWorldDarkCapBounds;
00065         bool mCastShadows;
00066 
00067 
00068     public:
00070         MovableObject();
00071 
00074         virtual ~MovableObject();
00075 
00077         virtual const String& getName(void) const = 0;
00078 
00080         virtual const String& getMovableType(void) const = 0;
00081 
00088         virtual Node* getParentNode(void) const;
00089 
00092         virtual void _notifyAttached(Node* parent, bool isTagPoint = false);
00093 
00095         virtual bool isAttached(void) const;
00096 
00102         virtual void _notifyCurrentCamera(Camera* cam) = 0;
00103 
00108         virtual const AxisAlignedBox& getBoundingBox(void) const = 0;
00109 
00113         virtual Real getBoundingRadius(void) const = 0;
00114 
00116         virtual const AxisAlignedBox& getWorldBoundingBox(bool derive = false) const;
00118         virtual const Sphere& getWorldBoundingSphere(bool derive = false) const;
00124         virtual void _updateRenderQueue(RenderQueue* queue) = 0;
00125 
00127         virtual void setVisible(bool visible);
00128 
00130         virtual bool isVisible(void) const;
00131 
00138         virtual void setUserObject(UserDefinedObject* obj) { mUserObject = obj; }
00142         virtual UserDefinedObject* getUserObject(void) { return mUserObject; }
00143 
00155         virtual void setRenderQueueGroup(RenderQueueGroupID queueID);
00156 
00158         virtual RenderQueueGroupID getRenderQueueGroup(void) const;
00159 
00161         virtual Matrix4 _getParentNodeFullTransform(void) const;
00162 
00170         virtual void setQueryFlags(unsigned long flags) { mQueryFlags = flags; }
00171 
00174         virtual void addQueryFlags(unsigned long flags) { mQueryFlags |= flags; }
00175             
00178         virtual void removeQueryFlags(unsigned long flags) { mQueryFlags ^= flags; }
00179         
00181         virtual unsigned long getQueryFlags(void) const { return mQueryFlags; }
00182 
00184         EdgeData* getEdgeList(void) { return NULL; }
00186         ShadowRenderableListIterator getShadowVolumeRenderableIterator(
00187             ShadowTechnique shadowTechnique, const Light* light, 
00188             HardwareIndexBufferSharedPtr* indexBuffer, 
00189             bool extrudeVertices, Real extrusionDist, unsigned long flags = 0 )
00190         {
00191             static ShadowRenderableList dummyList;
00192             return ShadowRenderableListIterator(dummyList.begin(), dummyList.end());
00193         }
00195         const AxisAlignedBox& getLightCapBounds(void) const;
00197         const AxisAlignedBox& getDarkCapBounds(const Light& light, Real dirLightExtrusionDist) const;
00210         void setCastShadows(bool enabled) { mCastShadows = enabled; }
00212         bool getCastShadows(void) const { return mCastShadows; }
00214         Real getPointExtrusionDistance(const Light* l) const;
00215 
00216 
00217 
00218 
00219 
00220     };
00221 
00222 }
00223 #endif

Copyright © 2002-2003 by The OGRE Team
Last modified Fri May 14 23:22:28 2004