fix btInMemorySerializer

This commit is contained in:
Erwin Coumans
2014-09-16 20:14:31 -07:00
parent dd526e7da9
commit 1fccfc4e28

View File

@@ -669,11 +669,13 @@ public:
} }
}; };
///In general it is best to use btDefaultSerializer,
///In general it is best to use btDefaultSerializer,
///in particular when writing the data to disk or sending it over the network. ///in particular when writing the data to disk or sending it over the network.
///The btInMemorySerializer is experimental and only suitable in a few cases. ///The btInMemorySerializer is experimental and only suitable in a few cases.
///The btInMemorySerializer takes a shortcut and can be useful to create a deep-copy ///The btInMemorySerializer takes a shortcut and can be useful to create a deep-copy
///of objects. There will be a demo on how to use the btInMemorySerializer. ///of objects. There will be a demo on how to use the btInMemorySerializer.
#define ENABLE_INMEMORY_SERIALIZER
#ifdef ENABLE_INMEMORY_SERIALIZER #ifdef ENABLE_INMEMORY_SERIALIZER
struct btInMemorySerializer : public btDefaultSerializer struct btInMemorySerializer : public btDefaultSerializer
@@ -797,7 +799,7 @@ struct btInMemorySerializer : public btDefaultSerializer
case BT_CONSTRAINT_CODE: case BT_CONSTRAINT_CODE:
{ {
#ifdef BT_USE_DOUBLE_PRECISION #ifdef BT_USE_DOUBLE_PRECISION
m_arrays.m_constraintDataDouble.push_back(btTypedConstraintDoubleData*)chunk->m_oldPtr); m_arrays.m_constraintDataDouble.push_back((btTypedConstraintDoubleData*)chunk->m_oldPtr);
#else #else
m_arrays.m_constraintDataFloat.push_back((btTypedConstraintFloatData*)chunk->m_oldPtr); m_arrays.m_constraintDataFloat.push_back((btTypedConstraintFloatData*)chunk->m_oldPtr);
#endif #endif
@@ -806,13 +808,13 @@ struct btInMemorySerializer : public btDefaultSerializer
case BT_QUANTIZED_BVH_CODE: case BT_QUANTIZED_BVH_CODE:
{ {
#ifdef BT_USE_DOUBLE_PRECISION #ifdef BT_USE_DOUBLE_PRECISION
m_arrays.m_bvhsFloat.push_back((btQuantizedBvhDoubleData*) chunk->m_oldPtr); m_arrays.m_bvhsDouble.push_back((btQuantizedBvhDoubleData*) chunk->m_oldPtr);
#else #else
m_arrays.m_bvhsFloat.push_back((btQuantizedBvhFloatData*) chunk->m_oldPtr); m_arrays.m_bvhsFloat.push_back((btQuantizedBvhFloatData*) chunk->m_oldPtr);
#endif #endif
break; break;
} }
case BT_SHAPE_CODE: case BT_SHAPE_CODE:
{ {
btCollisionShapeData* shapeData = (btCollisionShapeData*) chunk->m_oldPtr; btCollisionShapeData* shapeData = (btCollisionShapeData*) chunk->m_oldPtr;