Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | 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-2006 Torus Knot Software Ltd
    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 You may alternatively use this source under the terms of a specific version of
    00025 the OGRE Unrestricted License provided you have obtained such a license from
    00026 Torus Knot Software Ltd.
    00027 -----------------------------------------------------------------------------
    00028 */
    00029 #ifndef __SubMesh_H_
    00030 #define __SubMesh_H_
    00031
    00032 #include "OgrePrerequisites.h"
    00033
    00034 #include "OgreVertexIndexData.h"
    00035 #include "OgreMaterial.h"
    00036 #include "OgreRenderOperation.h"
    00037 #include "OgreVertexBoneAssignment.h"
    00038 #include "OgreProgressiveMesh.h"
    00039 #include "OgreAnimationTrack.h"
    00040
    00041 namespace Ogre {
    00042
    00056     class _OgreExport SubMesh
    00057     {
    00058         friend class Mesh;
    00059         friend class MeshSerializerImpl;
    00060         friend class MeshSerializerImpl_v1_2;
    00061         friend class MeshSerializerImpl_v1_1;
    00062     public:
    00063         SubMesh();
    00064         ~SubMesh();
    00065
    00066
    00068         bool useSharedVertices;
    00069
    00071         RenderOperation::OperationType operationType;
    00072
    00080         VertexData *vertexData;
    00081
    00083         IndexData *indexData;
    00084
    00104         typedef std::vector<unsigned short> IndexMap;
    00105         IndexMap blendIndexToBoneIndexMap;
    00106
    00107         ProgressiveMesh::LODFaceList mLodFaceList;
    00108
    00128         std::vector<Vector3> extremityPoints;
    00129
    00131         Mesh* parent;
    00132
    00134         void setMaterialName(const String& matName);
    00135         const String& getMaterialName(void) const;
    00136
    00139         bool isMatInitialised(void) const;
    00140
    00147         void _getRenderOperation(RenderOperation& rend, ushort lodIndex = 0);
    00148
    00161         void addBoneAssignment(const VertexBoneAssignment& vertBoneAssign);
    00162
    00168         void clearBoneAssignments(void);
    00169
    00171         typedef std::multimap<size_t, VertexBoneAssignment> VertexBoneAssignmentList;
    00172         typedef MapIterator<VertexBoneAssignmentList> BoneAssignmentIterator;
    00173
    00178         BoneAssignmentIterator getBoneAssignmentIterator(void);
    00179
    00181         void _compileBoneAssignments(void);
    00182
    00183         typedef ConstMapIterator<AliasTextureNamePairList> AliasTextureIterator;
    00187         AliasTextureIterator getAliasTextureIterator(void) const;
    00198         void addTextureAlias(const String& aliasName, const String& textureName);
    00204         void removeTextureAlias(const String& aliasName);
    00207         void removeAllTextureAliases(void);
    00210         bool hasTextureAliases(void) const { return !mTextureAliases.empty(); }
    00213         size_t getTextureAliasCount(void) const { return mTextureAliases.size(); }
    00214
    00225         bool updateMaterialUsingTextureAliases(void);
    00226
    00229         VertexAnimationType getVertexAnimationType(void) const;
    00230
    00235         void generateExtremes(size_t count);
    00236
    00237     protected:
    00238
    00240         String mMaterialName;
    00241
    00243         bool mMatInitialised;
    00244
    00246         AliasTextureNamePairList mTextureAliases;
    00247
    00248         VertexBoneAssignmentList mBoneAssignments;
    00249
    00251         bool mBoneAssignmentsOutOfDate;
    00252
    00254         mutable VertexAnimationType mVertexAnimationType;
    00255
    00256
    00258         void removeLodLevels(void);
    00259
    00260
    00261
    00262     };
    00263
    00264 } // namespace
    00265
    00266 #endif
    00267

Copyright © 2000-2005 by The OGRE Team
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Thu Mar 6 09:46:26 2008