本文整理汇总了C++中MeshPtr::GetIndexData方法的典型用法代码示例。如果您正苦于以下问题:C++ MeshPtr::GetIndexData方法的具体用法?C++ MeshPtr::GetIndexData怎么用?C++ MeshPtr::GetIndexData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MeshPtr
的用法示例。
在下文中一共展示了MeshPtr::GetIndexData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Create
void SubMesh::Create(MeshPtr pMesh, int indexOffset, int indexCount, int vertexOffset, int vertexCount, int vertexStride, int matIndex, int primCount, PRIMITIVE_TYPE primType, const VertexFormat& vf, G_FORMAT indexFormat)
{
m_pMesh = pMesh;
m_indexOffset = indexOffset;
m_vertexOffset = vertexOffset;
m_vertexCount = vertexCount;
m_indexCount = indexCount;
m_primitiveCount = primCount;
m_materialIndex = matIndex;
m_vertexStride = vertexStride;
m_indexed = pMesh->GetIndexData() == NULL ? false : true;
m_primitiveType = primType;
m_vertexFormat = vf;
m_indexFormat = indexFormat;
}
示例2: Reset
void MeshRenderer::Reset(MeshDataPtr pMD)
{
if(pMD == NULL)
{
return;
}
MeshPtr pMesh = pMD->GetMesh();
if(pMesh == nullptr)
{
return;
}
if(m_pIndexBuffer)
{
m_pIndexBuffer->Release();
m_pIndexBuffer.reset();
}
if(m_pVertexBuffer)
{
m_pVertexBuffer->Release();
m_pVertexBuffer.reset();
}
m_Subsets.clear();
if(pMesh->GetIndexData() != nullptr)
{
m_pIndexBuffer = m_pRS->GetSysGraphics()->CreateBuffer(BT_INDEX_BUFFER, pMesh->GetIndexDataBytes(), pMesh->GetIndexData(), false);
}
m_pVertexBuffer = m_pRS->GetSysGraphics()->CreateBuffer(BT_VERTEX_BUFFER, pMesh->GetVertexDataBytes(), pMesh->GetVertexData(), false);
for(int i = 0; i < pMesh->GetSubMeshCount(); ++i)
{
SubMeshPtr pSub = pMesh->GetSubMesh(i);
SubMeshRenderDataPtr pSR = m_pManager->GetAllocator()->AllocObject<SubMeshRenderData, GameObjectPtr>(GetGameObject());
pSR->Create(pSub, m_pIndexBuffer, m_pVertexBuffer);
m_Subsets.push_back(pSR);
}
}