- support both 32bit and 16bit indices in ColladaConverter

- added triangle part/index into btManifoldPoint
This commit is contained in:
ejcoumans
2008-02-09 03:34:53 +00:00
parent 6b3587a505
commit fe4e81ebff
3 changed files with 26 additions and 6 deletions

View File

@@ -1362,7 +1362,7 @@ ColladaConverter::addConcaveMesh(btCollisionShape* shape, const char* nodeName)
btAssert (vertexBase);
btAssert (indexBase);
btAssert (vertexType == PHY_FLOAT);
btAssert (indexType == PHY_INTEGER);
//we will need 3 sources for this mesh. positions, normals, and UVs
domSource *positionSrc = daeSafeCast<domSource>( mesh->createAndPlace( COLLADA_ELEMENT_SOURCE ) );
@@ -1428,14 +1428,24 @@ ColladaConverter::addConcaveMesh(btCollisionShape* shape, const char* nodeName)
//each set of three is one number per input-offset. for this example it's vert, normal, uv.
//three sets of three indices per triangle
for (int t = 0; t < numFaces; t++)
if (indexType == PHY_SHORT)
{
int* index = (int*)indexBase;
indices.append3( index[0], index[1], index[2]);
indexBase += indexStride;
for (int t = 0; t < numFaces; t++)
{
short int* index = (short int*)indexBase;
indices.append3( index[0], index[1], index[2]);
indexBase += indexStride;
}
} else
{
for (int t = 0; t < numFaces; t++)
{
int* index = (int*)indexBase;
indices.append3( index[0], index[1], index[2]);
indexBase += indexStride;
}
}
meshInterface->unLockReadOnlyVertexBase (i);
}
}