Software Archive
Read-only legacy content
17061 Discussions

PXCBlockMesh data

christopher_b_3
Beginner
404 Views

When iterating over the PXCBlock data returned from DoMeshingUpdate, there are blocks that have zero for numFaces and numVertices. In the examples, this is handled by something along the lines of :

if( (pPXCBlockMeshData->numVertices > 0) && ( pPXCBlockMeshData->numFaces > 0) )

... process data ...

Looking over the Unity sample, I noticed that that code will instead add the mesh id of these meshes to a destruction queue and then delete the mesh, if ti exists.

There's nothing in the SDK docs that specifies that there will be meshes with no data or what to do with them.

There's nothing in the header files that specifies that there will be meshes with no data or what to do with them.

There's nothing in the C++ samples that does anything with meshes with zero data.

So, what is the going on with these meshes ?

0 Kudos
1 Reply
Xusheng_L_Intel
Employee
404 Views

mesh block with same id and vertices = 0-> Yes it means block has been modified and now contains 0 vertices -> delete the block

In our C++  sample code, we are clearly deleting blocks.

it = m_currentMeshes.find(iMeshId);
if (it != m_currentMeshes.end())
{
     // delete old buffer
     glDeleteLists(it->second, 1);

     // delete old item
     m_currentMeshes.erase(it);
}
--------------Only create if vertices count is >0---------------------
// create new buffers
if((pPXCBlockMeshData->numVertices > 0) && (pPXCBlockMeshData->numFaces > 0))
{
// create new GL list
.....
}

Thanks!

 

0 Kudos
Reply