Terrain mesh has 0 indicies but 65536 vertices
Posted: Mon Jan 26, 2009 7:34 am
When I get the mesh from a terrain scene node, and I check the mesh buffers, it ends up with a total of 0 indicies in the mesh, and 65536 vertices.
This means I can't convert it to a Newton mesh. The code I'm using to check is shown below. Is there something I'm doing wrong?
This means I can't convert it to a Newton mesh. The code I'm using to check is shown below. Is there something I'm doing wrong?
Code: Select all
// Check for validity
test_mbc = mesh->getMeshBufferCount();
if (test_mbc <= 0)
{
nonlua_debug("Invalid terrain specified for physics object (no mesh buffers).",LVL_WARN);
physType = E_TYPE_IGNORE;
break;
}
has_indicies = false;
for (int i = 0; i < mesh->getMeshBufferCount(); i++)
{
mb = mesh->getMeshBuffer(i);
if (mb)
if (mb->getIndexCount() > 0)
{
has_indicies = true;
break;
}
}
if (!has_indicies)
{
nonlua_debug("Invalid terrain specified for physics object (no indicies).",LVL_WARN);
physType = E_TYPE_IGNORE;
break;
}