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 
00143         virtual void setVisible(bool visible);
00144 
00146         virtual bool isVisible(void) const;
00147 
00154         virtual void setUserObject(UserDefinedObject* obj) { mUserObject = obj; }
00158         virtual UserDefinedObject* getUserObject(void) { return mUserObject; }
00159 
00171         virtual void setRenderQueueGroup(RenderQueueGroupID queueID);
00172 
00174         virtual RenderQueueGroupID getRenderQueueGroup(void) const;
00175 
00177         virtual Matrix4 _getParentNodeFullTransform(void) const;
00178 
00186         virtual void setQueryFlags(unsigned long flags) { mQueryFlags = flags; }
00187 
00190         virtual void addQueryFlags(unsigned long flags) { mQueryFlags |= flags; }
00191             
00194         virtual void removeQueryFlags(unsigned long flags) { mQueryFlags ^= flags; }
00195         
00197         virtual unsigned long getQueryFlags(void) const { return mQueryFlags; }
00198 
00200         EdgeData* getEdgeList(void) { return NULL; }
00202         ShadowRenderableListIterator getShadowVolumeRenderableIterator(
00203             ShadowTechnique shadowTechnique, const Light* light, 
00204             HardwareIndexBufferSharedPtr* indexBuffer, 
00205             bool extrudeVertices, Real extrusionDist, unsigned long flags = 0);
00206         
00208         const AxisAlignedBox& getLightCapBounds(void) const;
00210         const AxisAlignedBox& getDarkCapBounds(const Light& light, Real dirLightExtrusionDist) const;
00223         void setCastShadows(bool enabled) { mCastShadows = enabled; }
00225         bool getCastShadows(void) const { return mCastShadows; }
00227         Real getPointExtrusionDistance(const Light* l) const;
00228 
00229 
00230 
00231 
00232 
00233     };
00234 
00235 }
00236 #endif

Copyright © 2000-2005 by The OGRE Team
Last modified Wed Feb 23 00:19:09 2005