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 
00035 namespace Ogre {
00036 
00037 
00043     class _OgreExport MovableObject
00044     {
00045     protected:
00047         Node* mParentNode;
00048         bool mParentIsTagPoint;
00050         bool mVisible;
00052         UserDefinedObject *mUserObject;
00054         RenderQueueGroupID mRenderQueueID;
00056         unsigned long mQueryFlags;
00058         mutable AxisAlignedBox mWorldAABB;
00059         // Cached world bounding sphere
00060         mutable Sphere mWorldBoundingSphere;
00061 
00062     public:
00064         MovableObject();
00065 
00068         virtual ~MovableObject();
00069 
00071         virtual const String& getName(void) const = 0;
00072 
00074         virtual const String& getMovableType(void) const = 0;
00075 
00082         virtual Node* getParentNode(void) const;
00083 
00086         virtual void _notifyAttached(Node* parent, bool isTagPoint = false);
00087 
00089         virtual bool isAttached(void) const;
00090 
00096         virtual void _notifyCurrentCamera(Camera* cam) = 0;
00097 
00102         virtual const AxisAlignedBox& getBoundingBox(void) const = 0;
00103 
00107         virtual Real getBoundingRadius(void) const = 0;
00108 
00110         virtual const AxisAlignedBox& getWorldBoundingBox(bool derive = false) const;
00112         virtual const Sphere& getWorldBoundingSphere(bool derive = false) const;
00118         virtual void _updateRenderQueue(RenderQueue* queue) = 0;
00119 
00121         virtual void setVisible(bool visible);
00122 
00124         virtual bool isVisible(void) const;
00125 
00132         virtual void setUserObject(UserDefinedObject* obj) { mUserObject = obj; }
00136         virtual UserDefinedObject* getUserObject(void) { return mUserObject; }
00137 
00149         virtual void setRenderQueueGroup(RenderQueueGroupID queueID);
00150 
00152         virtual RenderQueueGroupID getRenderQueueGroup(void) const;
00153 
00155         virtual Matrix4 _getParentNodeFullTransform(void) const;
00156 
00164         virtual void setQueryFlags(unsigned long flags) { mQueryFlags = flags; }
00165 
00168         virtual void addQueryFlags(unsigned long flags) { mQueryFlags |= flags; }
00169             
00172         virtual void removeQueryFlags(unsigned long flags) { mQueryFlags ^= flags; }
00173         
00175         virtual unsigned long getQueryFlags(void) const { return mQueryFlags; }
00176 
00177 
00178 
00179 
00180 
00181     };
00182 
00183 }
00184 #endif

Copyright © 2002-2003 by The OGRE Team
Last modified Wed Jan 21 00:10:19 2004