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:
erwin.coumans
2010-02-04 05:28:17 +00:00
parent af1dafc659
commit 99d9fddc42
12 changed files with 440 additions and 416 deletions

View File

@@ -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";
}