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 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 00113 virtual void _notifyCurrentCamera(Camera* cam) = 0; 00114 00119 virtual const AxisAlignedBox& getBoundingBox(void) const = 0; 00120 00124 virtual Real getBoundingRadius(void) const = 0; 00125 00127 virtual const AxisAlignedBox& getWorldBoundingBox(bool derive = false) const; 00129 virtual const Sphere& getWorldBoundingSphere(bool derive = false) const; 00135 virtual void _updateRenderQueue(RenderQueue* queue) = 0; 00136 00138 virtual void setVisible(bool visible); 00139 00141 virtual bool isVisible(void) const; 00142 00149 virtual void setUserObject(UserDefinedObject* obj) { mUserObject = obj; } 00153 virtual UserDefinedObject* getUserObject(void) { return mUserObject; } 00154 00166 virtual void setRenderQueueGroup(RenderQueueGroupID queueID); 00167 00169 virtual RenderQueueGroupID getRenderQueueGroup(void) const; 00170 00172 virtual Matrix4 _getParentNodeFullTransform(void) const; 00173 00181 virtual void setQueryFlags(unsigned long flags) { mQueryFlags = flags; } 00182 00185 virtual void addQueryFlags(unsigned long flags) { mQueryFlags |= flags; } 00186 00189 virtual void removeQueryFlags(unsigned long flags) { mQueryFlags ^= flags; } 00190 00192 virtual unsigned long getQueryFlags(void) const { return mQueryFlags; } 00193 00195 EdgeData* getEdgeList(void) { return NULL; } 00197 ShadowRenderableListIterator getShadowVolumeRenderableIterator( 00198 ShadowTechnique shadowTechnique, const Light* light, 00199 HardwareIndexBufferSharedPtr* indexBuffer, 00200 bool extrudeVertices, Real extrusionDist, unsigned long flags = 0 ) 00201 { 00202 static ShadowRenderableList dummyList; 00203 return ShadowRenderableListIterator(dummyList.begin(), dummyList.end()); 00204 } 00205 00206 ShadowRenderableListIterator getLastShadowVolumeRenderableIterator(void) 00207 { 00208 static ShadowRenderableList dummyList; 00209 return ShadowRenderableListIterator(dummyList.begin(), dummyList.end()); 00210 } 00211 00212 00214 const AxisAlignedBox& getLightCapBounds(void) const; 00216 const AxisAlignedBox& getDarkCapBounds(const Light& light, Real dirLightExtrusionDist) const; 00229 void setCastShadows(bool enabled) { mCastShadows = enabled; } 00231 bool getCastShadows(void) const { return mCastShadows; } 00233 Real getPointExtrusionDistance(const Light* l) const; 00234 00235 00236 00237 00238 00239 }; 00240 00241 } 00242 #endif
Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:48:35 2004