OgreSubMesh.h
Go to the documentation of this file.
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2013 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------------------------------------------------------------------------
*/
#ifndef __SubMesh_H_
#define __SubMesh_H_
#include "OgrePrerequisites.h"
#include "OgreVertexIndexData.h"
#include "OgreMaterial.h"
#include "OgreRenderOperation.h"
#include "OgreVertexBoneAssignment.h"
#include "OgreAnimationTrack.h"
#include "OgreResourceGroupManager.h"
#include "OgreHeaderPrefix.h"
namespace Ogre {
class _OgreExport SubMesh : public SubMeshAlloc
{
friend class Mesh;
friend class MeshSerializerImpl;
friend class MeshSerializerImpl_v1_2;
friend class MeshSerializerImpl_v1_1;
public:
SubMesh();
~SubMesh();
bool useSharedVertices;
RenderOperation::OperationType operationType;
VertexData *vertexData;
IndexData *indexData;
typedef vector<unsigned short>::type IndexMap;
IndexMap blendIndexToBoneIndexMap;
typedef vector<IndexData*>::type LODFaceList;
LODFaceList mLodFaceList;
vector<Vector3>::type extremityPoints;
Mesh* parent;
void setMaterialName(const String& matName, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME );
const String& getMaterialName(void) const;
bool isMatInitialised(void) const;
void _getRenderOperation(RenderOperation& rend, ushort lodIndex = 0);
void addBoneAssignment(const VertexBoneAssignment& vertBoneAssign);
void clearBoneAssignments(void);
typedef multimap<size_t, VertexBoneAssignment>::type VertexBoneAssignmentList;
typedef MapIterator<VertexBoneAssignmentList> BoneAssignmentIterator;
BoneAssignmentIterator getBoneAssignmentIterator(void);
const VertexBoneAssignmentList& getBoneAssignments() { return mBoneAssignments; }
void _compileBoneAssignments(void);
typedef ConstMapIterator<AliasTextureNamePairList> AliasTextureIterator;
AliasTextureIterator getAliasTextureIterator(void) const;
void addTextureAlias(const String& aliasName, const String& textureName);
void removeTextureAlias(const String& aliasName);
void removeAllTextureAliases(void);
bool hasTextureAliases(void) const { return !mTextureAliases.empty(); }
size_t getTextureAliasCount(void) const { return mTextureAliases.size(); }
bool updateMaterialUsingTextureAliases(void);
VertexAnimationType getVertexAnimationType(void) const;
bool getVertexAnimationIncludesNormals() const { return mVertexAnimationIncludesNormals; }
void generateExtremes(size_t count);
bool isBuildEdgesEnabled(void) const { return mBuildEdgesEnabled; }
void setBuildEdgesEnabled(bool b);
SubMesh * clone(const String& newName, Mesh *parentMesh = 0);
protected:
String mMaterialName;
bool mMatInitialised;
AliasTextureNamePairList mTextureAliases;
VertexBoneAssignmentList mBoneAssignments;
bool mBoneAssignmentsOutOfDate;
mutable VertexAnimationType mVertexAnimationType;
mutable bool mVertexAnimationIncludesNormals;
bool mBuildEdgesEnabled;
void removeLodLevels(void);
};
} // namespace
#include "OgreHeaderSuffix.h"
#endif
Ogre::SubMesh::IndexMap
vector< unsigned short >::type IndexMap
Dedicated index map for translate blend index to bone index (only valid if useSharedVertices = false)...
Definition: OgreSubMesh.h:110
Ogre::SubMesh::mVertexAnimationType
VertexAnimationType mVertexAnimationType
Type of vertex animation for dedicated vertex data (populated by Mesh)
Definition: OgreSubMesh.h:283
Ogre::SubMesh::indexData
IndexData * indexData
Face index data.
Definition: OgreSubMesh.h:89
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
Ogre::SubMesh::mTextureAliases
AliasTextureNamePairList mTextureAliases
paired list of texture aliases and texture names
Definition: OgreSubMesh.h:275
Ogre::VertexData
Summary class collecting together vertex source information.
Definition: OgreVertexIndexData.h:49
Ogre::SubMesh::mVertexAnimationIncludesNormals
bool mVertexAnimationIncludesNormals
Whether normals are included in vertex animation keyframes.
Definition: OgreSubMesh.h:286
Ogre::MapIterator
Concrete IteratorWrapper for nonconst access to the underlying key-value container.
Definition: OgreIteratorWrapper.h:319
Ogre::ConstMapIterator
Concrete IteratorWrapper for const access to the underlying key-value container.
Definition: OgreIteratorWrapper.h:352
Ogre::SubMesh::getBoneAssignments
const VertexBoneAssignmentList & getBoneAssignments()
Gets a const reference to the list of bone assignments.
Definition: OgreSubMesh.h:189
Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME
static String AUTODETECT_RESOURCE_GROUP_NAME
Special resource group name which causes resource group to be automatically determined based on searc...
Definition: OgreResourceGroupManager.h:270
Ogre::SubMesh::BoneAssignmentIterator
MapIterator< VertexBoneAssignmentList > BoneAssignmentIterator
Definition: OgreSubMesh.h:179
Ogre::IndexData
Summary class collecting together index data source information.
Definition: OgreVertexIndexData.h:242
Ogre::SubMesh::hasTextureAliases
bool hasTextureAliases(void) const
returns true if the sub mesh has texture aliases
Definition: OgreSubMesh.h:222
Ogre::MeshSerializerImpl_v1_2
Class for providing backwards-compatibility for loading version 1.2 of the .mesh format.
Definition: OgreMeshSerializerImpl.h:238
Ogre::SubMesh::mMaterialName
String mMaterialName
Name of the material this SubMesh uses.
Definition: OgreSubMesh.h:269
OgreAnimationTrack.h
Ogre::SubMesh::LODFaceList
vector< IndexData * >::type LODFaceList
Definition: OgreSubMesh.h:113
Ogre::SubMesh::AliasTextureIterator
ConstMapIterator< AliasTextureNamePairList > AliasTextureIterator
Definition: OgreSubMesh.h:195
OgreVertexBoneAssignment.h
Ogre::SubMesh
Defines a part of a complete mesh.
Definition: OgreSubMesh.h:62
Ogre::SubMesh::parent
Mesh * parent
Reference to parent Mesh (not a smart pointer so child does not keep parent alive).
Definition: OgreSubMesh.h:138
OgreVertexIndexData.h
Ogre::VertexAnimationType
VertexAnimationType
Type of vertex animation.
Definition: OgreAnimationTrack.h:467
OgrePrerequisites.h
Ogre::AliasTextureNamePairList
map< String, String >::type AliasTextureNamePairList
Alias / Texture name pair (first = alias, second = texture name)
Definition: OgreCommon.h:553
Ogre::SubMesh::mMatInitialised
bool mMatInitialised
Is there a material yet?
Definition: OgreSubMesh.h:272
Ogre::SubMesh::mLodFaceList
LODFaceList mLodFaceList
Definition: OgreSubMesh.h:114
Ogre::MeshSerializerImpl_v1_1
Class for providing backwards-compatibility for loading version 1.1 of the .mesh format.
Definition: OgreMeshSerializerImpl.h:259
Ogre::SubMesh::operationType
RenderOperation::OperationType operationType
The render operation type used to render this submesh.
Definition: OgreSubMesh.h:77
Ogre::SubMesh::isBuildEdgesEnabled
bool isBuildEdgesEnabled(void) const
Returns true(by default) if the submesh should be included in the mesh EdgeList, otherwise returns fa...
Definition: OgreSubMesh.h:255
Ogre::Mesh
Resource holding data about 3D mesh.
Definition: OgreMesh.h:93
OgreRenderOperation.h
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::SubMesh::getTextureAliasCount
size_t getTextureAliasCount(void) const
Gets the number of texture aliases assigned to the sub mesh.
Definition: OgreSubMesh.h:225
Ogre::RenderOperation::OperationType
OperationType
The rendering operation type to perform.
Definition: OgreRenderOperation.h:48
OgreHeaderSuffix.h
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::MeshSerializerImpl
Internal implementation of Mesh reading / writing for the latest version of the .mesh format...
Definition: OgreMeshSerializerImpl.h:61
Ogre::SubMesh::mBoneAssignments
VertexBoneAssignmentList mBoneAssignments
Definition: OgreSubMesh.h:277
Ogre::SubMesh::getVertexAnimationIncludesNormals
bool getVertexAnimationIncludesNormals() const
Returns whether animation on dedicated vertex data includes normals.
Definition: OgreSubMesh.h:244
Ogre::SubMesh::useSharedVertices
bool useSharedVertices
Indicates if this submesh shares vertex data with other meshes or whether it has it&#39;s own vertices...
Definition: OgreSubMesh.h:74
Ogre::vector
Definition: OgrePrerequisites.h:491
OgreHeaderPrefix.h
Ogre::VertexBoneAssignment_s
Records the assignment of a single vertex to a single bone with the corresponding weight...
Definition: OgreVertexBoneAssignment.h:50
Ogre::RenderOperation
&#39;New&#39; rendering operation using vertex buffers.
Definition: OgreRenderOperation.h:45
OgreResourceGroupManager.h
Ogre::SubMesh::mBuildEdgesEnabled
bool mBuildEdgesEnabled
Is Build Edges Enabled.
Definition: OgreSubMesh.h:289
Ogre::ushort
unsigned short ushort
Definition: OgrePrerequisites.h:113
OgreMaterial.h
Ogre::SubMesh::VertexBoneAssignmentList
multimap< size_t, VertexBoneAssignment >::type VertexBoneAssignmentList
Multimap of verex bone assignments (orders by vertex index)
Definition: OgreSubMesh.h:178
Ogre::SubMesh::extremityPoints
vector< Vector3 >::type extremityPoints
A list of extreme points on the submesh (optional).
Definition: OgreSubMesh.h:135
Ogre::SubMesh::blendIndexToBoneIndexMap
IndexMap blendIndexToBoneIndexMap
Definition: OgreSubMesh.h:111
Ogre::AllocatedObject
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Definition: OgreMemoryAllocatedObject.h:58
Ogre::SubMesh::vertexData
VertexData * vertexData
Dedicated vertex data (only valid if useSharedVertices = false).
Definition: OgreSubMesh.h:86
Ogre::multimap
Definition: OgrePrerequisites.h:547
Ogre::SubMesh::mBoneAssignmentsOutOfDate
bool mBoneAssignmentsOutOfDate
Flag indicating that bone assignments need to be recompiled.
Definition: OgreSubMesh.h:280

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.