remove Extras/obsolete/quickstep

improve serialization based on feedback: make it easier to serialize a single object, or single shape, or single bvh.
Modified Bullet/Demos/ConcaveDemo to use btSerializer to serialize the btOptimizedBvh (or optionally the trimesh+bvh)

You can also serialize trimesh without BVH, use:
serializer->setSerializationFlags(BT_SERIALIZE_NO_BVH);//	or BT_SERIALIZE_NO_TRIANGLEINFOMAP
This commit is contained in:
erwin.coumans
2010-02-25 20:12:40 +00:00
parent 44503b20a9
commit 40dc18f604
272 changed files with 561 additions and 44611 deletions

View File

@@ -439,5 +439,28 @@ const char* btBvhTriangleMeshShape::serialize(void* dataBuffer, btSerializer* se
return "btTriangleMeshShapeData";
}
void btBvhTriangleMeshShape::serializeSingleBvh(btSerializer* serializer) const
{
if (m_bvh)
{
int len = m_bvh->calculateSerializeBufferSizeNew(); //make sure not to use calculateSerializeBufferSize because it is used for in-place
btChunk* chunk = serializer->allocate(len,1);
const char* structType = m_bvh->serialize(chunk->m_oldPtr, serializer);
serializer->finalizeChunk(chunk,structType,BT_QUANTIZED_BVH_CODE,(void*)m_bvh);
}
}
void btBvhTriangleMeshShape::serializeSingleTriangleInfoMap(btSerializer* serializer) const
{
if (m_triangleInfoMap)
{
int len = m_triangleInfoMap->calculateSerializeBufferSize();
btChunk* chunk = serializer->allocate(len,1);
const char* structType = m_triangleInfoMap->serialize(chunk->m_oldPtr, serializer);
serializer->finalizeChunk(chunk,structType,BT_TRIANLGE_INFO_MAP,(void*)m_triangleInfoMap);
}
}