fix a serialization bug with btStridingMeshInterface with short indices (16 bit)
This commit is contained in:
@@ -1112,7 +1112,7 @@ btRigidBody* btBulletWorldImporter::getRigidBodyByName(const char* name)
|
|||||||
btRigidBody** bodyPtr = m_nameBodyMap.find(name);
|
btRigidBody** bodyPtr = m_nameBodyMap.find(name);
|
||||||
if (bodyPtr && *bodyPtr)
|
if (bodyPtr && *bodyPtr)
|
||||||
{
|
{
|
||||||
*bodyPtr;
|
return *bodyPtr;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -252,7 +252,7 @@ const char* btStridingMeshInterface::serialize(void* dataBuffer, btSerializer* s
|
|||||||
int numindices = numtriangles*3;
|
int numindices = numtriangles*3;
|
||||||
if (numindices)
|
if (numindices)
|
||||||
{
|
{
|
||||||
btChunk* chunk = serializer->allocate(sizeof(btIntIndexData),numindices);
|
btChunk* chunk = serializer->allocate(sizeof(btShortIntIndexData),numindices);
|
||||||
btShortIntIndexData* tmpIndices = (btShortIntIndexData*)chunk->m_oldPtr;
|
btShortIntIndexData* tmpIndices = (btShortIntIndexData*)chunk->m_oldPtr;
|
||||||
memPtr->m_indices16 = tmpIndices;
|
memPtr->m_indices16 = tmpIndices;
|
||||||
for (gfxindex=0;gfxindex<numtriangles;gfxindex++)
|
for (gfxindex=0;gfxindex<numtriangles;gfxindex++)
|
||||||
|
|||||||
Reference in New Issue
Block a user