00001 /* 00002 ----------------------------------------------------------------------------- 00003 This source file is part of OGRE 00004 (Object-oriented Graphics Rendering Engine) 00005 For the latest info, see http://ogre.sourceforge.net/ 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 #ifndef _SceneNode_H__ 00026 #define _SceneNode_H__ 00027 00028 #include "OgrePrerequisites.h" 00029 00030 #include "OgreNode.h" 00031 #include "OgreIteratorWrappers.h" 00032 00033 namespace Ogre { 00034 00044 class _OgreExport SceneNode : public Node 00045 { 00046 public: 00047 typedef HashMap<String, MovableObject*, _StringHash> ObjectMap; 00048 typedef MapIterator<ObjectMap> ObjectIterator; 00049 00050 protected: 00051 ObjectMap mObjectsByName; 00052 00054 WireBoundingBox *mWireBoundingBox; 00056 bool mShowBoundingBox; 00057 00059 SceneManager* mCreator; 00060 00062 AxisAlignedBox mWorldAABB; 00063 00066 virtual void _updateBounds(void); 00067 00069 Node* createChildImpl(void); 00070 00072 Node* createChildImpl(const String& name); 00073 public: 00078 SceneNode(SceneManager* creator); 00083 SceneNode(SceneManager* creator, const String& name); 00084 ~SceneNode(); 00085 00096 SceneNode* createChild(const Vector3& translate = Vector3::ZERO, const Quaternion& rotate = Quaternion::IDENTITY); 00097 00107 SceneNode* createChild(const String& name, const Vector3& translate = Vector3::ZERO, const Quaternion& rotate = Quaternion::IDENTITY); 00108 00113 SceneNode* getChild(unsigned short index) const; 00114 00116 SceneNode* getChild(const String& name) const; 00117 00123 SceneNode* removeChild(unsigned short index); 00124 00128 SceneNode* removeChild(const String& name); 00129 00135 void attachObject(MovableObject* obj); 00136 00139 unsigned short numAttachedObjects(void); 00140 00145 MovableObject* getAttachedObject(unsigned short index); 00146 00150 MovableObject* getAttachedObject(const String& name); 00151 00157 MovableObject* detachObject(unsigned short index); 00158 00160 MovableObject* detachObject(const String& name); 00161 00164 void detachAllObjects(void); 00165 00170 void attachLight(Light* l); 00171 00176 void attachCamera(Camera* ent); 00177 00190 virtual void _update(bool updateChildren, bool parentHasChanged); 00191 00208 void _findVisibleObjects(Camera* cam, RenderQueue* queue, 00209 bool includeChildren = true, bool displayNodes = false); 00210 00216 AxisAlignedBox _getWorldAABB(void) const; 00217 00228 ObjectIterator getAttachedObjectIterator(void); 00229 00230 00236 SceneManager* getCreator(void); 00237 00248 void removeAndDestroyChild(const String& name); 00249 00260 void removeAndDestroyChild(unsigned short index); 00261 00268 void removeAndDestroyAllChildren(void); 00269 00274 void showBoundingBox(bool bShow); 00275 00278 void _addBoundingBoxToQueue(RenderQueue* queue); 00279 00287 bool getShowBoundingBox(); 00288 00289 }; 00290 00291 00292 }// namespace 00293 00294 #endif
Copyright © 2002 by The OGRE Team