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

OgreEntity.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://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 __Entity_H__
00026 #define __Entity_H__
00027 
00028 #include "OgrePrerequisites.h"
00029 #include "OgreCommon.h"
00030 
00031 #include "OgreString.h"
00032 #include "OgreMovableObject.h"
00033 #include "OgreAnimationState.h"
00034 
00035 namespace Ogre {
00067     class _OgreExport Entity: public MovableObject
00068     {
00069         // Allow SceneManager full access
00070         friend class SceneManager;
00071         friend class SubEntity;
00072     private:
00073 
00076         Entity();
00079         Entity( const String& name, Mesh* mesh, SceneManager* creator);
00080 
00083         String mName;
00084 
00087         Mesh* mMesh;
00088 
00091         typedef std::vector<SubEntity*> SubEntityList;
00092         SubEntityList mSubEntityList;
00093 
00097         SceneManager* mCreatorSceneManager;
00098 
00099 
00101         AnimationStateSet mAnimationState;
00102 
00104         static String msMovableType;
00105 
00106 
00108         Matrix4 *mBoneMatrices;
00109         unsigned short mNumBoneMatrices;
00110 
00112         void cacheBoneMatrices(void);
00113 
00115         bool mDisplaySkeleton;
00116 
00117 
00119         ushort mMeshLodIndex;
00120 
00122         Real mMeshLodFactorInv;
00124         ushort mMinMeshLodIndex;
00126         ushort mMaxMeshLodIndex;
00127 
00129         bool mUsingManualLOD;
00134         typedef std::vector<SubEntityList*> LODSubEntityList;
00135         LODSubEntityList mLodSubEntityList;
00136 
00138         void buildSubEntityList(Mesh* mesh, SubEntityList* sublist);
00139 
00140 
00141     public:
00144         ~Entity();
00145 
00148         Mesh* getMesh(void);
00149 
00152         SubEntity* getSubEntity(unsigned int index);
00153 
00156         unsigned int getNumSubEntities(void);
00157 
00167         Entity* clone( const String& newName );
00168 
00177         void setMaterialName(const String& name);
00178 
00181         void _notifyCurrentCamera(Camera* cam);
00182 
00185         const AxisAlignedBox& getBoundingBox(void) const;
00186 
00189         void _updateRenderQueue(RenderQueue* queue);
00190 
00192         const String& getName(void) const;
00193 
00195         const String getMovableType(void) const;
00196 
00203         AnimationState* getAnimationState(const String& name);
00210         AnimationStateSet* getAllAnimationStates(void);
00211 
00214         void setDisplaySkeleton(bool display);
00215 
00216 
00243         void setLodBias(Real factor = 1.0, ushort maxDetailIndex = 0, ushort minDetailIndex = 99);
00244             
00246         void setRenderDetail(SceneDetailLevel renderDetail);
00247 
00248     };
00249 
00250 } // namespace
00251 
00252 #endif

Copyright © 2002 by The OGRE Team