More work on serialization and BulletFileLoader
This commit is contained in:
@@ -310,43 +310,9 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual int calculateSerializeBufferSize();
|
||||
|
||||
///fills the dataBuffer and returns the struct name (and 0 on failure)
|
||||
virtual const char* serialize(void* dataBuffer) const;
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
struct btBoxShapeData
|
||||
{
|
||||
btCollisionShapeData m_collisionShapeData;
|
||||
btVector3Data m_halfExtents;
|
||||
btVector3Data m_localScaling;
|
||||
};
|
||||
|
||||
|
||||
|
||||
SIMD_FORCE_INLINE int btBoxShape::calculateSerializeBufferSize()
|
||||
{
|
||||
return sizeof(btBoxShapeData);
|
||||
}
|
||||
|
||||
///fills the dataBuffer and returns the struct name (and 0 on failure)
|
||||
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);
|
||||
return "btBoxShapeData";
|
||||
}
|
||||
|
||||
|
||||
#endif //OBB_BOX_MINKOWSKI_H
|
||||
|
||||
|
||||
|
||||
@@ -109,11 +109,54 @@ public:
|
||||
btAssert(0);
|
||||
}
|
||||
|
||||
virtual int calculateSerializeBufferSize();
|
||||
|
||||
///fills the dataBuffer and returns the struct name (and 0 on failure)
|
||||
virtual const char* serialize(void* dataBuffer) const;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
struct btConvexInternalShapeData
|
||||
{
|
||||
btCollisionShapeData m_collisionShapeData;
|
||||
|
||||
btVector3Data m_localScaling;
|
||||
|
||||
btVector3Data m_implicitShapeDimensions;
|
||||
|
||||
btScalar m_collisionMargin;
|
||||
|
||||
char m_padding[4];
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
SIMD_FORCE_INLINE int btConvexInternalShape::calculateSerializeBufferSize()
|
||||
{
|
||||
return sizeof(btConvexInternalShapeData);
|
||||
}
|
||||
|
||||
///fills the dataBuffer and returns the struct name (and 0 on failure)
|
||||
SIMD_FORCE_INLINE const char* btConvexInternalShape::serialize(void* dataBuffer) const
|
||||
{
|
||||
btConvexInternalShapeData* shapeData = (btConvexInternalShapeData*) dataBuffer;
|
||||
btCollisionShape::serialize(&shapeData->m_collisionShapeData);
|
||||
|
||||
m_implicitShapeDimensions.serialize(shapeData->m_implicitShapeDimensions);
|
||||
m_localScaling.serialize(shapeData->m_localScaling);
|
||||
shapeData->m_collisionMargin = m_collisionMargin;
|
||||
|
||||
return "btConvexInternalShapeData";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
///btConvexInternalAabbCachingShape adds local aabb caching for convex shapes, to avoid expensive bounding box calculations
|
||||
class btConvexInternalAabbCachingShape : public btConvexInternalShape
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user