- support both 32bit and 16bit indices in ColladaConverter
- added triangle part/index into btManifoldPoint
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,6 +87,11 @@ void btManifoldResult::addContactPoint(const btVector3& normalOnBInWorld,const b
|
||||
newPt.m_combinedFriction = calculateCombinedFriction(m_body0,m_body1);
|
||||
newPt.m_combinedRestitution = calculateCombinedRestitution(m_body0,m_body1);
|
||||
|
||||
//BP mod, store contact triangles.
|
||||
newPt.m_partId0 = m_partId0;
|
||||
newPt.m_partId1 = m_partId1;
|
||||
newPt.m_index0 = m_index0;
|
||||
newPt.m_index1 = m_index1;
|
||||
|
||||
///todo, check this for any side effects
|
||||
if (insertIndex >= 0)
|
||||
|
||||
@@ -65,6 +65,11 @@ class btManifoldPoint
|
||||
btScalar m_combinedFriction;
|
||||
btScalar m_combinedRestitution;
|
||||
|
||||
//BP mod, store contact triangles.
|
||||
int m_partId0;
|
||||
int m_partId1;
|
||||
int m_index0;
|
||||
int m_index1;
|
||||
|
||||
mutable void* m_userPersistentData;
|
||||
btScalar m_appliedImpulse;
|
||||
|
||||
Reference in New Issue
Block a user