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

OgreSubMesh.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 (c) 2000-2005 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 __SubMesh_H_
00026 #define __SubMesh_H_
00027 
00028 #include "OgrePrerequisites.h"
00029 
00030 #include "OgreVertexIndexData.h"
00031 #include "OgreMaterial.h"
00032 #include "OgreRenderOperation.h"
00033 #include "OgreVertexBoneAssignment.h"
00034 #include "OgreProgressiveMesh.h"
00035 #include "OgreAnimationTrack.h"
00036 
00037 namespace Ogre {
00038 
00052     class _OgreExport SubMesh
00053     {
00054         friend class Mesh;
00055         friend class MeshSerializerImpl;
00056         friend class MeshSerializerImpl_v1_2;
00057         friend class MeshSerializerImpl_v1_1;
00058     public:
00059         SubMesh();
00060         ~SubMesh();
00061 
00062 
00064         bool useSharedVertices;
00065 
00067         RenderOperation::OperationType operationType;
00068 
00076         VertexData *vertexData;
00077 
00079         IndexData *indexData;
00080 
00100         typedef std::vector<unsigned short> IndexMap;
00101         IndexMap blendIndexToBoneIndexMap;
00102 
00103         ProgressiveMesh::LODFaceList mLodFaceList;
00104 
00106         Mesh* parent;
00107 
00109         void setMaterialName(const String& matName);
00110         const String& getMaterialName(void) const;
00111 
00114         bool isMatInitialised(void) const;
00115 
00122         void _getRenderOperation(RenderOperation& rend, ushort lodIndex = 0);
00123 
00136         void addBoneAssignment(const VertexBoneAssignment& vertBoneAssign);
00137 
00143         void clearBoneAssignments(void);
00144 
00146         typedef std::multimap<size_t, VertexBoneAssignment> VertexBoneAssignmentList;
00147         typedef MapIterator<VertexBoneAssignmentList> BoneAssignmentIterator;
00148 
00153         BoneAssignmentIterator getBoneAssignmentIterator(void);
00154 
00156         void _compileBoneAssignments(void);
00157 
00158         typedef ConstMapIterator<AliasTextureNamePairList> AliasTextureIterator;
00162         AliasTextureIterator getAliasTextureIterator(void) const;
00173         void addTextureAlias(const String& aliasName, const String& textureName);
00179         void removeTextureAlias(const String& aliasName);
00182         void removeAllTextureAliases(void);
00185         bool hasTextureAliases(void) const { return !mTextureAliases.empty(); }
00188         size_t getTextureAliasCount(void) const { return mTextureAliases.size(); }
00189 
00200         bool updateMaterialUsingTextureAliases(void);
00201 
00204         VertexAnimationType getVertexAnimationType(void) const;
00205 
00206     protected:
00207 
00209         String mMaterialName;
00210 
00212         bool mMatInitialised;
00213 
00215         AliasTextureNamePairList mTextureAliases;
00216 
00217         VertexBoneAssignmentList mBoneAssignments;
00218 
00220         bool mBoneAssignmentsOutOfDate;
00221 
00223         mutable VertexAnimationType mVertexAnimationType;
00224 
00225 
00227         void removeLodLevels(void);
00228 
00229 
00230 
00231     };
00232 
00233 } // namespace
00234 
00235 #endif
00236 

Copyright © 2000-2005 by The OGRE Team
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Mar 12 14:37:50 2006