本文整理汇总了C++中ogre::VertexDeclaration::getMaxSource方法的典型用法代码示例。如果您正苦于以下问题:C++ VertexDeclaration::getMaxSource方法的具体用法?C++ VertexDeclaration::getMaxSource怎么用?C++ VertexDeclaration::getMaxSource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::VertexDeclaration
的用法示例。
在下文中一共展示了VertexDeclaration::getMaxSource方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doExportMesh
//.........这里部分代码省略.........
word nIndices[3];
msTriangle_GetVertexIndices (pTriangle, nIndices);
msVec3 Normal;
msVec2 uv;
int k, vertIdx;
for (k = 0; k < 3; ++k)
{
vertIdx = nIndices[k];
// Face index
pIdx[j+k] = vertIdx;
// Vertex normals
// For the moment, ignore any discrepancies per vertex
msTriangleEx_GetNormal(pTriangleEx, k, &Normal[0]);
msTriangleEx_GetTexCoord(pTriangleEx, k, &uv[0]);
pTex[(vertIdx*2)]=uv[0];
pTex[(vertIdx*2)+1]=uv[1];
pNorm[(vertIdx*3)] = Normal[0];
pNorm[(vertIdx*3)+1] = Normal[1];
pNorm[(vertIdx*3)+2] = Normal[2];
}
} // Faces
nbuf->unlock();
ibuf->unlock();
tbuf->unlock();
// Now use Ogre's ability to reorganise the vertex buffers the best way
Ogre::VertexDeclaration* newDecl =
ogreSubMesh->vertexData->vertexDeclaration->getAutoOrganisedDeclaration(
foundBoneAssignment, false);
Ogre::BufferUsageList bufferUsages;
for (size_t u = 0; u <= newDecl->getMaxSource(); ++u)
bufferUsages.push_back(Ogre::HardwareBuffer::HBU_STATIC_WRITE_ONLY);
ogreSubMesh->vertexData->reorganiseBuffers(newDecl, bufferUsages);
logMgr.logMessage("Geometry done.");
} // SubMesh
// Set bounds
ogreMesh->_setBoundingSphereRadius(Ogre::Math::Sqrt(maxSquaredRadius));
ogreMesh->_setBounds(Ogre::AxisAlignedBox(min, max), false);
// Keep hold of a Skeleton pointer for deletion later
// Mesh uses Skeleton pointer for skeleton name
Ogre::SkeletonPtr pSkel;
if (exportSkeleton && foundBoneAssignment)
{
// export skeleton, also update mesh to point to it
pSkel = doExportSkeleton(pModel, ogreMesh);
}
else if (!exportSkeleton && foundBoneAssignment)
{
// We've found bone assignments, but skeleton is not to be exported
// Prompt the user to find the skeleton
if (!locateSkeleton(ogreMesh))
return;
}
// Export
logMgr.logMessage("Creating MeshSerializer..");