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 __Overlay_H__ 00027 #define __Overlay_H__ 00028 00029 #include "OgrePrerequisites.h" 00030 #include "OgreSceneNode.h" 00031 #include "OgreIteratorWrappers.h" 00032 #include "OgreMatrix4.h" 00033 #include "OgreResource.h" 00034 00035 namespace Ogre { 00036 00037 00062 class _OgreExport Overlay : public Resource 00063 { 00064 00065 protected: 00066 ushort mZOrder; 00067 bool mVisible; 00069 SceneNode* mRootNode; 00070 // 2D elements 00071 // GuiContainers, linked list for easy sorting by zorder later 00072 // Not a map because sort can be saved since changes infrequent (unlike render queue) 00073 typedef std::list<GuiContainer*> GuiContainerList; 00074 GuiContainerList m2DElements; 00075 00076 // Degrees of rotation around center 00077 Real mRotate; 00078 // Scroll values, offsets 00079 Real mScrollX, mScrollY; 00080 // Scale values 00081 Real mScaleX, mScaleY; 00082 00083 mutable Matrix4 mTransform; 00084 mutable bool mTransformOutOfDate; 00086 void updateTransform(void) const; 00087 00088 public: 00090 Overlay(const String& name); 00091 virtual ~Overlay(); 00092 00094 virtual void load(void); 00096 virtual void unload(void); 00097 00098 GuiContainer* getChild(const String& name); 00099 00101 const String& getName(void) const; 00106 void setZOrder(ushort zorder); 00108 ushort getZOrder(void) const; 00109 00111 bool isVisible(void) const; 00112 00114 void show(void); 00115 00117 void hide(void); 00118 00129 void add2D(GuiContainer* cont); 00130 00131 00136 void remove2D(GuiContainer* cont); 00137 00166 void add3D(SceneNode* node); 00167 00169 void remove3D(SceneNode* node); 00170 00172 void clear(); 00173 00183 void setScroll(Real x, Real y); 00184 00186 Real getScrollX(void) const; 00187 00189 Real getScrollY(void) const; 00190 00197 void scroll(Real xoff, Real yoff); 00198 00200 void setRotate(Real degrees); 00201 00203 Real getRotate(void) const; 00204 00206 void rotate(Real degrees); 00207 00208 00216 void setScale(Real x, Real y); 00217 00219 Real getScaleX(void) const; 00220 00222 Real getScaleY(void) const; 00223 00225 void _getWorldTransforms(Matrix4* xform) const; 00227 const Quaternion& getWorldOrientation(void) const; 00229 const Vector3& getWorldPosition(void) const; 00230 00232 void _findVisibleObjects(Camera* cam, RenderQueue* queue); 00233 00235 virtual GuiElement* findElementAt(Real x, Real y); 00236 00237 00238 }; 00239 00240 00241 00242 } 00243 00244 00245 #endif 00246
Copyright © 2002-2003 by The OGRE Team
Last modified Wed Jan 21 00:10:20 2004