add name for collision shape and constraint serialization (to objects, shapes and constaints can be mapped to user data)
updated serialization structures and header files (for new 'm_name' field, replacing user pointer) fix issue with btGeneric6DofConstraint::setParam in headerfile
This commit is contained in:
@@ -13,7 +13,7 @@ subject to the following restrictions:
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
#include "BulletCollision/CollisionShapes/btCollisionShape.h"
|
||||
|
||||
#include "LinearMath/btSerializer.h"
|
||||
|
||||
/*
|
||||
Make sure this dummy function never changes so that it
|
||||
@@ -94,3 +94,18 @@ void btCollisionShape::calculateTemporalAabb(const btTransform& curTrans,const b
|
||||
temporalAabbMin -= angularMotion3d;
|
||||
temporalAabbMax += angularMotion3d;
|
||||
}
|
||||
|
||||
///fills the dataBuffer and returns the struct name (and 0 on failure)
|
||||
const char* btCollisionShape::serialize(void* dataBuffer, btSerializer* serializer) const
|
||||
{
|
||||
btCollisionShapeData* shapeData = (btCollisionShapeData*) dataBuffer;
|
||||
shapeData->m_name = (char*) serializer->findNameForPointer(this);
|
||||
if (shapeData->m_name)
|
||||
{
|
||||
serializer->serializeName(shapeData->m_name);
|
||||
}
|
||||
shapeData->m_shapeType = m_shapeType;
|
||||
//shapeData->m_padding//??
|
||||
return "btCollisionShapeData";
|
||||
}
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ public:
|
||||
///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
|
||||
struct btCollisionShapeData
|
||||
{
|
||||
void *m_userPointer;
|
||||
char *m_name;
|
||||
int m_shapeType;
|
||||
char m_padding[4];
|
||||
};
|
||||
@@ -138,15 +138,7 @@ SIMD_FORCE_INLINE int btCollisionShape::calculateSerializeBufferSize() const
|
||||
return sizeof(btCollisionShapeData);
|
||||
}
|
||||
|
||||
///fills the dataBuffer and returns the struct name (and 0 on failure)
|
||||
SIMD_FORCE_INLINE const char* btCollisionShape::serialize(void* dataBuffer, btSerializer* serializer) const
|
||||
{
|
||||
btCollisionShapeData* shapeData = (btCollisionShapeData*) dataBuffer;
|
||||
shapeData->m_userPointer = m_userPointer;
|
||||
shapeData->m_shapeType = m_shapeType;
|
||||
//shapeData->m_padding//??
|
||||
return "btCollisionShapeData";
|
||||
}
|
||||
|
||||
|
||||
#endif //COLLISION_SHAPE_H
|
||||
|
||||
|
||||
Reference in New Issue
Block a user