Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class 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 (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 
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         bool mRenderQueueIDSet;
00059         unsigned long mQueryFlags;
00061         mutable AxisAlignedBox mWorldAABB;
00062         // Cached world bounding sphere
00063         mutable Sphere mWorldBoundingSphere;
00065         mutable AxisAlignedBox mWorldDarkCapBounds;
00067         bool mCastShadows;
00068 
00069 
00070     public:
00072         MovableObject();
00073 
00076         virtual ~MovableObject();
00077 
00079         virtual const String& getName(void) const = 0;
00080 
00082         virtual const String& getMovableType(void) const = 0;
00083 
00090         virtual Node* getParentNode(void) const;
00091 
00099         virtual SceneNode* getParentSceneNode(void) const;
00100 
00103         virtual void _notifyAttached(Node* parent, bool isTagPoint = false);
00104 
00106         virtual bool isAttached(void) const;
00107 
00111         virtual bool isInScene(void) const;
00112 
00118         virtual void _notifyCurrentCamera(Camera* cam) = 0;
00119 
00124         virtual const AxisAlignedBox& getBoundingBox(void) const = 0;
00125 
00129         virtual Real getBoundingRadius(void) const = 0;
00130 
00132         virtual const AxisAlignedBox& getWorldBoundingBox(bool derive = false) const;
00134         virtual const Sphere& getWorldBoundingSphere(bool derive = false) const;
00140         virtual void _updateRenderQueue(RenderQueue* queue) = 0;
00141 
00156         virtual void setVisible(bool visible);
00157 
00159         virtual bool isVisible(void) const;
00160 
00167         virtual void setUserObject(UserDefinedObject* obj) { mUserObject = obj; }
00171         virtual UserDefinedObject* getUserObject(void) { return mUserObject; }
00172 
00184         virtual void setRenderQueueGroup(RenderQueueGroupID queueID);
00185 
00187         virtual RenderQueueGroupID getRenderQueueGroup(void) const;
00188 
00190         virtual Matrix4 _getParentNodeFullTransform(void) const;
00191 
00199         virtual void setQueryFlags(unsigned long flags) { mQueryFlags = flags; }
00200 
00203         virtual void addQueryFlags(unsigned long flags) { mQueryFlags |= flags; }
00204             
00207         virtual void removeQueryFlags(unsigned long flags) { mQueryFlags &= ~flags; }
00208         
00210         virtual unsigned long getQueryFlags(void) const { return mQueryFlags; }
00211 
00213         EdgeData* getEdgeList(void) { return NULL; }
00215         ShadowRenderableListIterator getShadowVolumeRenderableIterator(
00216             ShadowTechnique shadowTechnique, const Light* light, 
00217             HardwareIndexBufferSharedPtr* indexBuffer, 
00218             bool extrudeVertices, Real extrusionDist, unsigned long flags = 0);
00219         
00221         const AxisAlignedBox& getLightCapBounds(void) const;
00223         const AxisAlignedBox& getDarkCapBounds(const Light& light, Real dirLightExtrusionDist) const;
00236         void setCastShadows(bool enabled) { mCastShadows = enabled; }
00238         bool getCastShadows(void) const { return mCastShadows; }
00240         Real getPointExtrusionDistance(const Light* l) const;
00241 
00242 
00243 
00244 
00245 
00246     };
00247 
00248 }
00249 #endif

Copyright © 2000-2005 by The OGRE Team
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Feb 12 12:59:48 2006