worked a bit more on the serialization, and added a preliminary SerializeDemo.

This commit is contained in:
erwin.coumans
2010-01-21 00:17:18 +00:00
parent 901ff7a4f8
commit 6af9f9434f
28 changed files with 3364 additions and 40 deletions

View File

@@ -323,6 +323,7 @@ public:
struct btBoxShapeData
{
btCollisionShapeData m_collisionShapeData;
btVector3Data m_halfExtents;
btVector3Data m_localScaling;
};
@@ -338,6 +339,7 @@ SIMD_FORCE_INLINE int btBoxShape::calculateSerializeBufferSize()
SIMD_FORCE_INLINE const char* btBoxShape::serialize(void* dataBuffer) const
{
btBoxShapeData* boxData = (btBoxShapeData*) dataBuffer;
btCollisionShape::serialize(&boxData->m_collisionShapeData);
m_implicitShapeDimensions.serialize(boxData->m_halfExtents);
m_localScaling.serialize(boxData->m_localScaling);

View File

@@ -118,6 +118,11 @@ public:
return m_userPointer;
}
virtual int calculateSerializeBufferSize();
///fills the dataBuffer and returns the struct name (and 0 on failure)
virtual const char* serialize(void* dataBuffer) const;
};
///for serialization
@@ -128,6 +133,20 @@ struct btCollisionShapeData
char m_padding[4];
};
SIMD_FORCE_INLINE int btCollisionShape::calculateSerializeBufferSize()
{
return sizeof(btCollisionShapeData);
}
///fills the dataBuffer and returns the struct name (and 0 on failure)
SIMD_FORCE_INLINE const char* btCollisionShape::serialize(void* dataBuffer) const
{
btCollisionShapeData* shapeData = (btCollisionShapeData*) dataBuffer;
shapeData->m_userPointer = m_userPointer;
shapeData->m_shapeType = m_shapeType;
//shapeData->m_padding//??
return "btCollisionShapeData";
}
#endif //COLLISION_SHAPE_H