本文整理汇总了C++中ogre::MeshPtr::getHandle方法的典型用法代码示例。如果您正苦于以下问题:C++ MeshPtr::getHandle方法的具体用法?C++ MeshPtr::getHandle怎么用?C++ MeshPtr::getHandle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::MeshPtr
的用法示例。
在下文中一共展示了MeshPtr::getHandle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UnloadModel
void CMapLoader::UnloadModel(Ogre::MeshPtr mesh)
{
Ogre::ResourceHandle handle = mesh->getHandle();
// Ogre::MeshManager::getSingleton().unload(handle);
Ogre::MeshManager::getSingleton().remove(handle);
std::vector<MapResource<Ogre::MeshPtr>>::iterator i;
for(i = meshes.begin();i != meshes.end();i++)
{
if(i->data.getPointer() == mesh.getPointer())
{
meshes.erase(i);
}
}
}
示例2: doExportMesh
//.........这里部分代码省略.........
// 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..");
Ogre::MeshSerializer serializer;
logMgr.logMessage("MeshSerializer created.");
// Generate LODs if required
if (generateLods)
{
// Build LOD depth list
Ogre::Mesh::LodDistanceList distList;
float depth = 0;
for (unsigned short depthidx = 0; depthidx < numLods; ++depthidx)
{
depth += lodDepthIncrement;
distList.push_back(depth);
}
ogreMesh->generateLodLevels(distList, lodReductionMethod, lodReductionAmount);
}
if (generateEdgeLists)
{
ogreMesh->buildEdgeList();
}
if (generateTangents)
{
unsigned short src, dest;
ogreMesh->suggestTangentVectorBuildParams(tangentSemantic, src, dest);
ogreMesh->buildTangentVectors(tangentSemantic, src, dest, tangentsSplitMirrored, tangentsSplitRotated, tangentsUseParity);
}
// Export
Ogre::String msg;
msg = "Exporting mesh data to file '" + Ogre::String(szFile) + "'";
logMgr.logMessage(msg);
serializer.exportMesh(ogreMesh.getPointer(), szFile);
logMgr.logMessage("Export successful");
Ogre::MeshManager::getSingleton().remove(ogreMesh->getHandle());
if (!pSkel.isNull())
Ogre::SkeletonManager::getSingleton().remove(pSkel->getHandle());
if (exportMaterials && msModel_GetMaterialCount(pModel) > 0)
{
doExportMaterials(pModel);
}
}