Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

OgreSceneNode.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 © 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         mutable LightList mLightList;
00053         mutable bool mLightListDirty;
00054 
00056         WireBoundingBox *mWireBoundingBox;
00058         bool mShowBoundingBox;
00059 
00061         SceneManager* mCreator;
00062 
00064         AxisAlignedBox mWorldAABB;
00065 
00068         virtual void _updateBounds(void);
00069 
00071         Node* createChildImpl(void);
00072 
00074         Node* createChildImpl(const String& name);
00075     public:
00080         SceneNode(SceneManager* creator);
00085         SceneNode(SceneManager* creator, const String& name);
00086         ~SceneNode();
00087 
00093         virtual void attachObject(MovableObject* obj);
00094 
00097         virtual unsigned short numAttachedObjects(void) const;
00098 
00103         virtual MovableObject* getAttachedObject(unsigned short index);
00104 
00108         virtual MovableObject* getAttachedObject(const String& name);
00109 
00115         virtual MovableObject* detachObject(unsigned short index);
00117         virtual void detachObject(MovableObject* obj);
00118 
00120         virtual MovableObject* detachObject(const String& name);
00121 
00124         virtual void detachAllObjects(void);
00125 
00130         void attachLight(Light* l);
00131 
00136         void attachCamera(Camera* ent);
00137 
00150         virtual void _update(bool updateChildren, bool parentHasChanged);
00151 
00168         virtual void _findVisibleObjects(Camera* cam, RenderQueue* queue, 
00169             bool includeChildren = true, bool displayNodes = false);
00170 
00176         virtual AxisAlignedBox _getWorldAABB(void) const;
00177 
00188         virtual ObjectIterator getAttachedObjectIterator(void);
00189 
00190 
00196         SceneManager* getCreator(void) const;
00197 
00208         virtual void removeAndDestroyChild(const String& name);
00209 
00220         virtual void removeAndDestroyChild(unsigned short index);
00221 
00228         virtual void removeAndDestroyAllChildren(void);
00229 
00234         virtual void showBoundingBox(bool bShow);
00235 
00238         virtual void _addBoundingBoxToQueue(RenderQueue* queue);
00239 
00247         virtual bool getShowBoundingBox() const;
00248 
00255         virtual SceneNode* createChildSceneNode(
00256             const Vector3& translate = Vector3::ZERO, 
00257             const Quaternion& rotate = Quaternion::IDENTITY );
00258 
00268         virtual SceneNode* createChildSceneNode(const String& name, const Vector3& translate = Vector3::ZERO, const Quaternion& rotate = Quaternion::IDENTITY);
00269 
00277         const LightList& getLights(void) const;
00278 
00279     };
00280 
00281 
00282 }// namespace
00283 
00284 #endif

Copyright © 2002-2003 by The OGRE Team
Last modified Wed Jan 21 00:10:26 2004