OGRE  1.9.0
OgreSubMesh.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4 (Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2014 Torus Knot Software Ltd
8
9Permission is hereby granted, free of charge, to any person obtaining a copy
10of this software and associated documentation files (the "Software"), to deal
11in the Software without restriction, including without limitation the rights
12to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13copies of the Software, and to permit persons to whom the Software is
14furnished to do so, subject to the following conditions:
15
16The above copyright notice and this permission notice shall be included in
17all copies or substantial portions of the Software.
18
19THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25THE SOFTWARE.
26-----------------------------------------------------------------------------
27*/
28#ifndef __SubMesh_H_
29#define __SubMesh_H_
30
31#include "OgrePrerequisites.h"
32
33#include "OgreVertexIndexData.h"
34#include "OgreMaterial.h"
35#include "OgreRenderOperation.h"
37#include "OgreAnimationTrack.h"
39#include "OgreHeaderPrefix.h"
40
41namespace Ogre {
42
63 {
64 friend class Mesh;
65 friend class MeshSerializerImpl;
68 public:
71
72
75
78
87
90
112
115
136
139
142 const String& getMaterialName(void) const;
143
146 bool isMatInitialised(void) const;
147
154 void _getRenderOperation(RenderOperation& rend, ushort lodIndex = 0);
155
168 void addBoneAssignment(const VertexBoneAssignment& vertBoneAssign);
169
176
180
186
190
191
194
210 void addTextureAlias(const String& aliasName, const String& textureName);
216 void removeTextureAlias(const String& aliasName);
222 bool hasTextureAliases(void) const { return !mTextureAliases.empty(); }
225 size_t getTextureAliasCount(void) const { return mTextureAliases.size(); }
226
238
242
245
246
251 void generateExtremes(size_t count);
252
255 bool isBuildEdgesEnabled(void) const { return mBuildEdgesEnabled; }
264 SubMesh * clone(const String& newName, Mesh *parentMesh = 0);
265
266 protected:
267
270
273
276
278
281
284
287
290
292 void removeLodLevels(void);
293
294
295 };
296
298
299} // namespace
300
301#include "OgreHeaderSuffix.h"
302
303#endif
304
305
#define _OgreExport
Concrete IteratorWrapper for const access to the underlying key-value container.
Summary class collecting together index data source information.
Concrete IteratorWrapper for nonconst access to the underlying key-value container.
'New' rendering operation using vertex buffers.
OperationType
The rendering operation type to perform.
static String AUTODETECT_RESOURCE_GROUP_NAME
Special resource group name which causes resource group to be automatically determined based on searc...
const String & getMaterialName(void) const
size_t getTextureAliasCount(void) const
Gets the number of texture aliases assigned to the sub mesh.
bool mVertexAnimationIncludesNormals
Whether normals are included in vertex animation keyframes.
RenderOperation::OperationType operationType
The render operation type used to render this submesh.
Definition OgreSubMesh.h:77
VertexData * vertexData
Dedicated vertex data (only valid if useSharedVertices = false).
Definition OgreSubMesh.h:86
VertexBoneAssignmentList mBoneAssignments
bool updateMaterialUsingTextureAliases(void)
The current material used by the submesh is copied into a new material and the submesh's texture alia...
ConstMapIterator< AliasTextureNamePairList > AliasTextureIterator
bool mMatInitialised
Is there a material yet?
void clearBoneAssignments(void)
Removes all bone assignments for this mesh.
void removeLodLevels(void)
Internal method for removing LOD data.
const VertexBoneAssignmentList & getBoneAssignments()
Gets a const reference to the list of bone assignments.
vector< IndexData * >::type LODFaceList
vector< Vector3 >::type extremityPoints
A list of extreme points on the submesh (optional).
void _getRenderOperation(RenderOperation &rend, ushort lodIndex=0)
Returns a RenderOperation structure required to render this mesh.
friend class MeshSerializerImpl
Definition OgreSubMesh.h:65
multimap< size_t, VertexBoneAssignment >::type VertexBoneAssignmentList
Multimap of verex bone assignments (orders by vertex index)
bool isMatInitialised(void) const
Returns true if a material has been assigned to the submesh, otherwise returns false.
bool mBuildEdgesEnabled
Is Build Edges Enabled.
bool hasTextureAliases(void) const
returns true if the sub mesh has texture aliases
VertexAnimationType mVertexAnimationType
Type of vertex animation for dedicated vertex data (populated by Mesh)
LODFaceList mLodFaceList
void removeAllTextureAliases(void)
removes all texture aliases from the sub mesh
void setMaterialName(const String &matName, const String &groupName=ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME)
Sets the name of the Material which this SubMesh will use.
void removeTextureAlias(const String &aliasName)
Remove a specific texture alias name from the sub mesh.
bool useSharedVertices
Indicates if this submesh shares vertex data with other meshes or whether it has it's own vertices.
Definition OgreSubMesh.h:74
bool mBoneAssignmentsOutOfDate
Flag indicating that bone assignments need to be recompiled.
MapIterator< VertexBoneAssignmentList > BoneAssignmentIterator
friend class Mesh
Definition OgreSubMesh.h:64
IndexData * indexData
Face index data.
Definition OgreSubMesh.h:89
AliasTextureNamePairList mTextureAliases
paired list of texture aliases and texture names
AliasTextureIterator getAliasTextureIterator(void) const
Gets an constant iterator to access all texture alias names assigned to this submesh.
BoneAssignmentIterator getBoneAssignmentIterator(void)
Gets an iterator for access all bone assignments.
void addBoneAssignment(const VertexBoneAssignment &vertBoneAssign)
Assigns a vertex to a bone with a given weight, for skeletal animation.
void addTextureAlias(const String &aliasName, const String &textureName)
Adds the alias or replaces an existing one and associates the texture name to it.
Mesh * parent
Reference to parent Mesh (not a smart pointer so child does not keep parent alive).
String mMaterialName
Name of the material this SubMesh uses.
bool isBuildEdgesEnabled(void) const
Returns true(by default) if the submesh should be included in the mesh EdgeList, otherwise returns fa...
void setBuildEdgesEnabled(bool b)
SubMesh * clone(const String &newName, Mesh *parentMesh=0)
Makes a copy of this submesh object and gives it a new name.
void _compileBoneAssignments(void)
Must be called once to compile bone assignments into geometry buffer.
VertexAnimationType getVertexAnimationType(void) const
Get the type of any vertex animation used by dedicated geometry.
friend class MeshSerializerImpl_v1_2
Definition OgreSubMesh.h:66
IndexMap blendIndexToBoneIndexMap
friend class MeshSerializerImpl_v1_1
Definition OgreSubMesh.h:67
void generateExtremes(size_t count)
Generate the submesh extremes (.
vector< unsignedshort >::type IndexMap
Dedicated index map for translate blend index to bone index (only valid if useSharedVertices = false)...
bool getVertexAnimationIncludesNormals() const
Returns whether animation on dedicated vertex data includes normals.
Summary class collecting together vertex source information.
struct Ogre::VertexBoneAssignment_s VertexBoneAssignment
Records the assignment of a single vertex to a single bone with the corresponding weight.
VertexAnimationType
Type of vertex animation.
map< String, String >::type AliasTextureNamePairList
Alias / Texture name pair (first = alias, second = texture name)
Definition OgreCommon.h:553
ResourceAllocatedObject SubMeshAlloc
_StringBase String
unsigned short ushort
std::multimap< K, V, P, A > type
std::vector< T, A > type