added serialization support for btCompoundShape, btCapsuleShapeX/Z, btCylinderShapeX,Z

make some serialization methods const
prepare for constraint serialization
This commit is contained in:
erwin.coumans
2010-01-26 02:24:03 +00:00
parent 2f44eabd7d
commit 44565d20f4
26 changed files with 594 additions and 190 deletions

View File

@@ -62,6 +62,11 @@ ATTRIBUTE_ALIGNED16(class) btCompoundShape : public btCollisionShape
///increment m_updateRevision when adding/removing/replacing child shapes, so that some caches can be updated
int m_updateRevision;
btScalar m_collisionMargin;
protected:
btVector3 m_localScaling;
public:
BT_DECLARE_ALIGNED_ALLOCATOR();
@@ -158,13 +163,46 @@ public:
return m_updateRevision;
}
private:
btScalar m_collisionMargin;
protected:
btVector3 m_localScaling;
virtual int calculateSerializeBufferSize() const;
///fills the dataBuffer and returns the struct name (and 0 on failure)
virtual const char* serialize(void* dataBuffer, btSerializer* serializer) const;
};
struct btCompoundShapeChildData
{
btTransformFloatData m_transform;
btCollisionShapeData *m_childShape;
int m_childShapeType;
float m_childMargin;
};
struct btCompoundShapeData
{
btCollisionShapeData m_collisionShapeData;
btCompoundShapeChildData *m_childShapePtr;
int m_numChildShapes;
float m_collisionMargin;
};
SIMD_FORCE_INLINE int btCompoundShape::calculateSerializeBufferSize() const
{
return sizeof(btCompoundShapeData);
}
#endif //COMPOUND_SHAPE_H