more work on serialization (work-in-progress)
This commit is contained in:
@@ -149,6 +149,12 @@ void SerializeDemo::initPhysics()
|
|||||||
//create a few dynamic rigidbodies
|
//create a few dynamic rigidbodies
|
||||||
// Re-using the same collision is better for memory usage and performance
|
// Re-using the same collision is better for memory usage and performance
|
||||||
|
|
||||||
|
int numSpheres = 2;
|
||||||
|
btVector3 positions[2] = {btVector3(0.1,0.2,0.3),btVector3(0.4,0.5,0.6)};
|
||||||
|
btScalar radii[2] = {0.3,0.4};
|
||||||
|
|
||||||
|
//btMultiSphereShape* colShape = new btMultiSphereShape(positions,radii,numSpheres);
|
||||||
|
|
||||||
btCollisionShape* colShape = new btCapsuleShape(SCALING*1,SCALING*1);
|
btCollisionShape* colShape = new btCapsuleShape(SCALING*1,SCALING*1);
|
||||||
//btCollisionShape* colShape = new btCylinderShape(btVector3(SCALING*1,SCALING*1,SCALING*1));
|
//btCollisionShape* colShape = new btCylinderShape(btVector3(SCALING*1,SCALING*1,SCALING*1));
|
||||||
//btCollisionShape* colShape = new btBoxShape(btVector3(SCALING*1,SCALING*1,SCALING*1));
|
//btCollisionShape* colShape = new btBoxShape(btVector3(SCALING*1,SCALING*1,SCALING*1));
|
||||||
@@ -242,6 +248,7 @@ void SerializeDemo::initPhysics()
|
|||||||
case CAPSULE_SHAPE_PROXYTYPE:
|
case CAPSULE_SHAPE_PROXYTYPE:
|
||||||
case BOX_SHAPE_PROXYTYPE:
|
case BOX_SHAPE_PROXYTYPE:
|
||||||
case SPHERE_SHAPE_PROXYTYPE:
|
case SPHERE_SHAPE_PROXYTYPE:
|
||||||
|
case MULTI_SPHERE_SHAPE_PROXYTYPE:
|
||||||
{
|
{
|
||||||
btConvexInternalShapeData* bsd = (btConvexInternalShapeData*)shapeData;
|
btConvexInternalShapeData* bsd = (btConvexInternalShapeData*)shapeData;
|
||||||
btVector3 implicitShapeDimensions;
|
btVector3 implicitShapeDimensions;
|
||||||
@@ -270,6 +277,19 @@ void SerializeDemo::initPhysics()
|
|||||||
shape = new btCylinderShape(implicitShapeDimensions+margin);
|
shape = new btCylinderShape(implicitShapeDimensions+margin);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case MULTI_SPHERE_SHAPE_PROXYTYPE:
|
||||||
|
{
|
||||||
|
#if 0
|
||||||
|
btMultiSphereShapeData* mss = (btMultiSphereShapeData*)bsd;
|
||||||
|
btVector3 pos[2];
|
||||||
|
pos[0].deSerialize(mss->m_localPositionArrayPtr[0]);
|
||||||
|
pos[1].deSerialize(mss->m_localPositionArrayPtr[1]);
|
||||||
|
|
||||||
|
btScalar radii[2] = {0.3,0.4};
|
||||||
|
shape = new btMultiSphereShape(pos,radii,mss->m_localPositionArraySize);
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
printf("error: cannot create shape type (%d)\n",shapeData->m_shapeType);
|
printf("error: cannot create shape type (%d)\n",shapeData->m_shapeType);
|
||||||
@@ -287,7 +307,6 @@ void SerializeDemo::initPhysics()
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
printf("unsupported shape type (%d)\n",shapeData->m_shapeType);
|
printf("unsupported shape type (%d)\n",shapeData->m_shapeType);
|
||||||
|
|||||||
@@ -93,39 +93,42 @@ void btBulletFile::parseData()
|
|||||||
|
|
||||||
// same as (BHEAD+DATA dependancy)
|
// same as (BHEAD+DATA dependancy)
|
||||||
dataPtrHead = dataPtr+ChunkUtils::getOffset(mFlags);
|
dataPtrHead = dataPtr+ChunkUtils::getOffset(mFlags);
|
||||||
char *id = readStruct(dataPtrHead, dataChunk);
|
if (dataChunk.dna_nr>=0)
|
||||||
|
|
||||||
// lookup maps
|
|
||||||
if (id)
|
|
||||||
{
|
{
|
||||||
mLibPointers.insert(dataChunk.oldPtr, (bStructHandle*)id);
|
char *id = readStruct(dataPtrHead, dataChunk);
|
||||||
|
|
||||||
m_chunks.push_back(dataChunk);
|
// lookup maps
|
||||||
// block it
|
if (id)
|
||||||
//bListBasePtr *listID = mMain->getListBasePtr(dataChunk.code);
|
{
|
||||||
//if (listID)
|
mLibPointers.insert(dataChunk.oldPtr, (bStructHandle*)id);
|
||||||
// listID->push_back((bStructHandle*)id);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dataChunk.code == BT_RIGIDBODY_CODE)
|
m_chunks.push_back(dataChunk);
|
||||||
{
|
// block it
|
||||||
m_rigidBodies.push_back((bStructHandle*) id);
|
//bListBasePtr *listID = mMain->getListBasePtr(dataChunk.code);
|
||||||
}
|
//if (listID)
|
||||||
|
// listID->push_back((bStructHandle*)id);
|
||||||
if (dataChunk.code == BT_COLLISIONOBJECT_CODE)
|
}
|
||||||
{
|
|
||||||
m_collisionObjects.push_back((bStructHandle*) id);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dataChunk.code == BT_SHAPE_CODE)
|
if (dataChunk.code == BT_RIGIDBODY_CODE)
|
||||||
{
|
{
|
||||||
m_collisionShapes.push_back((bStructHandle*) id);
|
m_rigidBodies.push_back((bStructHandle*) id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dataChunk.code == BT_COLLISIONOBJECT_CODE)
|
||||||
|
{
|
||||||
|
m_collisionObjects.push_back((bStructHandle*) id);
|
||||||
|
}
|
||||||
|
|
||||||
// if (dataChunk.code == GLOB)
|
if (dataChunk.code == BT_SHAPE_CODE)
|
||||||
// {
|
{
|
||||||
// m_glob = (bStructHandle*) id;
|
m_collisionShapes.push_back((bStructHandle*) id);
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
// if (dataChunk.code == GLOB)
|
||||||
|
// {
|
||||||
|
// m_glob = (bStructHandle*) id;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
// next please!
|
// next please!
|
||||||
dataPtr += seek;
|
dataPtr += seek;
|
||||||
|
|||||||
@@ -124,6 +124,7 @@ typedef unsigned long uintptr_t;
|
|||||||
#include "LinearMath/btTransform.h"
|
#include "LinearMath/btTransform.h"
|
||||||
#include "BulletCollision/CollisionShapes/btCollisionShape.h"
|
#include "BulletCollision/CollisionShapes/btCollisionShape.h"
|
||||||
#include "BulletCollision/CollisionShapes/btConvexInternalShape.h"
|
#include "BulletCollision/CollisionShapes/btConvexInternalShape.h"
|
||||||
|
#include "BulletCollision/CollisionShapes/btMultiSphereShape.h"
|
||||||
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
|
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
|
||||||
#include "BulletDynamics/Dynamics/btRigidBody.h"
|
#include "BulletDynamics/Dynamics/btRigidBody.h"
|
||||||
|
|
||||||
@@ -146,6 +147,7 @@ char *includefiles[] = {
|
|||||||
"../../../src/LinearMath/btTransform.h",
|
"../../../src/LinearMath/btTransform.h",
|
||||||
"../../../src/BulletCollision/CollisionShapes/btCollisionShape.h",
|
"../../../src/BulletCollision/CollisionShapes/btCollisionShape.h",
|
||||||
"../../../src/BulletCollision/CollisionShapes/btConvexInternalShape.h",
|
"../../../src/BulletCollision/CollisionShapes/btConvexInternalShape.h",
|
||||||
|
"../../../src/BulletCollision/CollisionShapes/btMultiSphereShape.h",
|
||||||
"../../../src/BulletCollision/CollisionDispatch/btCollisionObject.h",
|
"../../../src/BulletCollision/CollisionDispatch/btCollisionObject.h",
|
||||||
"../../../src/BulletDynamics/Dynamics/btRigidBody.h",
|
"../../../src/BulletDynamics/Dynamics/btRigidBody.h",
|
||||||
// empty string to indicate end of includefiles
|
// empty string to indicate end of includefiles
|
||||||
|
|||||||
@@ -1267,7 +1267,7 @@ void btCollisionWorld::serializeCollisionObjects(btDefaultSerializer* serializer
|
|||||||
//serialize all collision shapes
|
//serialize all collision shapes
|
||||||
int len = shape->calculateSerializeBufferSize();
|
int len = shape->calculateSerializeBufferSize();
|
||||||
btChunk* chunk = serializer->allocate(len,1);
|
btChunk* chunk = serializer->allocate(len,1);
|
||||||
const char* structType = shape->serialize(chunk->m_oldPtr);
|
const char* structType = shape->serialize(chunk->m_oldPtr, serializer);
|
||||||
chunk->m_dna_nr = serializer->getReverseType(structType);
|
chunk->m_dna_nr = serializer->getReverseType(structType);
|
||||||
chunk->m_chunkCode = BT_SHAPE_CODE;
|
chunk->m_chunkCode = BT_SHAPE_CODE;
|
||||||
chunk->m_oldPtr = shape;
|
chunk->m_oldPtr = shape;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ subject to the following restrictions:
|
|||||||
#include "LinearMath/btVector3.h"
|
#include "LinearMath/btVector3.h"
|
||||||
#include "LinearMath/btMatrix3x3.h"
|
#include "LinearMath/btMatrix3x3.h"
|
||||||
#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" //for the shape types
|
#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" //for the shape types
|
||||||
|
class btDefaultSerializer;
|
||||||
|
|
||||||
|
|
||||||
///The btCollisionShape class provides an interface for collision shapes that can be shared among btCollisionObjects.
|
///The btCollisionShape class provides an interface for collision shapes that can be shared among btCollisionObjects.
|
||||||
@@ -121,7 +121,7 @@ public:
|
|||||||
virtual int calculateSerializeBufferSize();
|
virtual int calculateSerializeBufferSize();
|
||||||
|
|
||||||
///fills the dataBuffer and returns the struct name (and 0 on failure)
|
///fills the dataBuffer and returns the struct name (and 0 on failure)
|
||||||
virtual const char* serialize(void* dataBuffer) const;
|
virtual const char* serialize(void* dataBuffer, btDefaultSerializer* serializer) const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ SIMD_FORCE_INLINE int btCollisionShape::calculateSerializeBufferSize()
|
|||||||
}
|
}
|
||||||
|
|
||||||
///fills the dataBuffer and returns the struct name (and 0 on failure)
|
///fills the dataBuffer and returns the struct name (and 0 on failure)
|
||||||
SIMD_FORCE_INLINE const char* btCollisionShape::serialize(void* dataBuffer) const
|
SIMD_FORCE_INLINE const char* btCollisionShape::serialize(void* dataBuffer, btDefaultSerializer* serializer) const
|
||||||
{
|
{
|
||||||
btCollisionShapeData* shapeData = (btCollisionShapeData*) dataBuffer;
|
btCollisionShapeData* shapeData = (btCollisionShapeData*) dataBuffer;
|
||||||
shapeData->m_userPointer = m_userPointer;
|
shapeData->m_userPointer = m_userPointer;
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ public:
|
|||||||
virtual int calculateSerializeBufferSize();
|
virtual int calculateSerializeBufferSize();
|
||||||
|
|
||||||
///fills the dataBuffer and returns the struct name (and 0 on failure)
|
///fills the dataBuffer and returns the struct name (and 0 on failure)
|
||||||
virtual const char* serialize(void* dataBuffer) const;
|
virtual const char* serialize(void* dataBuffer, btDefaultSerializer* serializer) const;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -142,10 +142,10 @@ SIMD_FORCE_INLINE int btConvexInternalShape::calculateSerializeBufferSize()
|
|||||||
}
|
}
|
||||||
|
|
||||||
///fills the dataBuffer and returns the struct name (and 0 on failure)
|
///fills the dataBuffer and returns the struct name (and 0 on failure)
|
||||||
SIMD_FORCE_INLINE const char* btConvexInternalShape::serialize(void* dataBuffer) const
|
SIMD_FORCE_INLINE const char* btConvexInternalShape::serialize(void* dataBuffer, btDefaultSerializer* serializer) const
|
||||||
{
|
{
|
||||||
btConvexInternalShapeData* shapeData = (btConvexInternalShapeData*) dataBuffer;
|
btConvexInternalShapeData* shapeData = (btConvexInternalShapeData*) dataBuffer;
|
||||||
btCollisionShape::serialize(&shapeData->m_collisionShapeData);
|
btCollisionShape::serialize(&shapeData->m_collisionShapeData, serializer);
|
||||||
|
|
||||||
m_implicitShapeDimensions.serialize(shapeData->m_implicitShapeDimensions);
|
m_implicitShapeDimensions.serialize(shapeData->m_implicitShapeDimensions);
|
||||||
m_localScaling.serialize(shapeData->m_localScaling);
|
m_localScaling.serialize(shapeData->m_localScaling);
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ subject to the following restrictions:
|
|||||||
#include "btMultiSphereShape.h"
|
#include "btMultiSphereShape.h"
|
||||||
#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
|
#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
|
||||||
#include "LinearMath/btQuaternion.h"
|
#include "LinearMath/btQuaternion.h"
|
||||||
|
#include "LinearMath/btSerializer.h"
|
||||||
|
|
||||||
btMultiSphereShape::btMultiSphereShape (const btVector3* positions,const btScalar* radi,int numSpheres)
|
btMultiSphereShape::btMultiSphereShape (const btVector3* positions,const btScalar* radi,int numSpheres)
|
||||||
:btConvexInternalAabbCachingShape ()
|
:btConvexInternalAabbCachingShape ()
|
||||||
@@ -138,3 +139,41 @@ void btMultiSphereShape::calculateLocalInertia(btScalar mass,btVector3& inertia)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///fills the dataBuffer and returns the struct name (and 0 on failure)
|
||||||
|
const char* btMultiSphereShape::serialize(void* dataBuffer, btDefaultSerializer* serializer) const
|
||||||
|
{
|
||||||
|
btMultiSphereShapeData* shapeData = (btMultiSphereShapeData*) dataBuffer;
|
||||||
|
btConvexInternalShape::serialize(&shapeData->m_convexInternalShapeData, serializer);
|
||||||
|
|
||||||
|
shapeData->m_localPositionArrayPtr = 0;
|
||||||
|
int numElem = m_localPositionArray.size();
|
||||||
|
|
||||||
|
|
||||||
|
shapeData->m_localPositionArraySize = numElem;
|
||||||
|
if (numElem)
|
||||||
|
{
|
||||||
|
void* oldPtr = (void*)&m_localPositionArray[0].getX();
|
||||||
|
shapeData->m_localPositionArrayPtr = (btVector3Data*)oldPtr;
|
||||||
|
|
||||||
|
int sz = sizeof(btVector3Data);
|
||||||
|
|
||||||
|
btChunk* chunk = serializer->allocate(sz,numElem);
|
||||||
|
const char* structType = "btVector3Data";
|
||||||
|
btVector3Data* memPtr = (btVector3Data*)chunk->m_oldPtr;
|
||||||
|
for (int i=0;i<numElem;i++)
|
||||||
|
{
|
||||||
|
m_localPositionArray[i].serialize(*memPtr);
|
||||||
|
memPtr++;
|
||||||
|
}
|
||||||
|
chunk->m_dna_nr = serializer->getReverseType("btVector3Data");
|
||||||
|
chunk->m_chunkCode = BT_VECTOR3_CODE;
|
||||||
|
chunk->m_oldPtr = oldPtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
shapeData->m_radiArrayPtr = 0;
|
||||||
|
shapeData->m_radiArraySize = 0;
|
||||||
|
|
||||||
|
return "btMultiSphereShapeData";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -61,8 +61,30 @@ public:
|
|||||||
return "MultiSphere";
|
return "MultiSphere";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual int calculateSerializeBufferSize();
|
||||||
|
|
||||||
|
///fills the dataBuffer and returns the struct name (and 0 on failure)
|
||||||
|
virtual const char* serialize(void* dataBuffer, btDefaultSerializer* serializer) const;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct btMultiSphereShapeData
|
||||||
|
{
|
||||||
|
btConvexInternalShapeData m_convexInternalShapeData;
|
||||||
|
|
||||||
|
btVector3Data *m_localPositionArrayPtr;
|
||||||
|
btScalar *m_radiArrayPtr;
|
||||||
|
int m_localPositionArraySize;
|
||||||
|
int m_radiArraySize;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
SIMD_FORCE_INLINE int btMultiSphereShape::calculateSerializeBufferSize()
|
||||||
|
{
|
||||||
|
return sizeof(btMultiSphereShapeData);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif //MULTI_SPHERE_MINKOWSKI_H
|
#endif //MULTI_SPHERE_MINKOWSKI_H
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
unsigned char sBulletDNAstr[]= {
|
unsigned char sBulletDNAstr[]= {
|
||||||
83,68,78,65,78,65,77,69,63,0,0,0,109,95,115,105,122,101,0,109,
|
83,68,78,65,78,65,77,69,68,0,0,0,109,95,115,105,122,101,0,109,
|
||||||
95,99,97,112,97,99,105,116,121,0,42,109,95,100,97,116,97,0,109,95,
|
95,99,97,112,97,99,105,116,121,0,42,109,95,100,97,116,97,0,109,95,
|
||||||
99,111,108,108,105,115,105,111,110,83,104,97,112,101,115,0,109,95,99,111,
|
99,111,108,108,105,115,105,111,110,83,104,97,112,101,115,0,109,95,99,111,
|
||||||
108,108,105,115,105,111,110,79,98,106,101,99,116,115,0,109,95,99,111,110,
|
108,108,105,115,105,111,110,79,98,106,101,99,116,115,0,109,95,99,111,110,
|
||||||
@@ -12,80 +12,88 @@ unsigned char sBulletDNAstr[]= {
|
|||||||
109,95,108,111,99,97,108,83,99,97,108,105,110,103,0,109,95,105,109,112,
|
109,95,108,111,99,97,108,83,99,97,108,105,110,103,0,109,95,105,109,112,
|
||||||
108,105,99,105,116,83,104,97,112,101,68,105,109,101,110,115,105,111,110,115,
|
108,105,99,105,116,83,104,97,112,101,68,105,109,101,110,115,105,111,110,115,
|
||||||
0,109,95,99,111,108,108,105,115,105,111,110,77,97,114,103,105,110,0,109,
|
0,109,95,99,111,108,108,105,115,105,111,110,77,97,114,103,105,110,0,109,
|
||||||
95,119,111,114,108,100,84,114,97,110,115,102,111,114,109,0,109,95,105,110,
|
95,99,111,110,118,101,120,73,110,116,101,114,110,97,108,83,104,97,112,101,
|
||||||
116,101,114,112,111,108,97,116,105,111,110,87,111,114,108,100,84,114,97,110,
|
68,97,116,97,0,42,109,95,108,111,99,97,108,80,111,115,105,116,105,111,
|
||||||
115,102,111,114,109,0,109,95,105,110,116,101,114,112,111,108,97,116,105,111,
|
110,65,114,114,97,121,80,116,114,0,42,109,95,114,97,100,105,65,114,114,
|
||||||
110,76,105,110,101,97,114,86,101,108,111,99,105,116,121,0,109,95,105,110,
|
97,121,80,116,114,0,109,95,108,111,99,97,108,80,111,115,105,116,105,111,
|
||||||
116,101,114,112,111,108,97,116,105,111,110,65,110,103,117,108,97,114,86,101,
|
110,65,114,114,97,121,83,105,122,101,0,109,95,114,97,100,105,65,114,114,
|
||||||
108,111,99,105,116,121,0,109,95,97,110,105,115,111,116,114,111,112,105,99,
|
97,121,83,105,122,101,0,109,95,119,111,114,108,100,84,114,97,110,115,102,
|
||||||
70,114,105,99,116,105,111,110,0,109,95,104,97,115,65,110,105,115,111,116,
|
111,114,109,0,109,95,105,110,116,101,114,112,111,108,97,116,105,111,110,87,
|
||||||
114,111,112,105,99,70,114,105,99,116,105,111,110,0,109,95,99,111,110,116,
|
111,114,108,100,84,114,97,110,115,102,111,114,109,0,109,95,105,110,116,101,
|
||||||
97,99,116,80,114,111,99,101,115,115,105,110,103,84,104,114,101,115,104,111,
|
114,112,111,108,97,116,105,111,110,76,105,110,101,97,114,86,101,108,111,99,
|
||||||
108,100,0,42,109,95,98,114,111,97,100,112,104,97,115,101,72,97,110,100,
|
105,116,121,0,109,95,105,110,116,101,114,112,111,108,97,116,105,111,110,65,
|
||||||
108,101,0,42,109,95,99,111,108,108,105,115,105,111,110,83,104,97,112,101,
|
110,103,117,108,97,114,86,101,108,111,99,105,116,121,0,109,95,97,110,105,
|
||||||
0,42,109,95,114,111,111,116,67,111,108,108,105,115,105,111,110,83,104,97,
|
115,111,116,114,111,112,105,99,70,114,105,99,116,105,111,110,0,109,95,104,
|
||||||
112,101,0,109,95,99,111,108,108,105,115,105,111,110,70,108,97,103,115,0,
|
97,115,65,110,105,115,111,116,114,111,112,105,99,70,114,105,99,116,105,111,
|
||||||
109,95,105,115,108,97,110,100,84,97,103,49,0,109,95,99,111,109,112,97,
|
110,0,109,95,99,111,110,116,97,99,116,80,114,111,99,101,115,115,105,110,
|
||||||
110,105,111,110,73,100,0,109,95,97,99,116,105,118,97,116,105,111,110,83,
|
103,84,104,114,101,115,104,111,108,100,0,42,109,95,98,114,111,97,100,112,
|
||||||
116,97,116,101,49,0,109,95,100,101,97,99,116,105,118,97,116,105,111,110,
|
104,97,115,101,72,97,110,100,108,101,0,42,109,95,99,111,108,108,105,115,
|
||||||
84,105,109,101,0,109,95,102,114,105,99,116,105,111,110,0,109,95,114,101,
|
105,111,110,83,104,97,112,101,0,42,109,95,114,111,111,116,67,111,108,108,
|
||||||
115,116,105,116,117,116,105,111,110,0,109,95,105,110,116,101,114,110,97,108,
|
105,115,105,111,110,83,104,97,112,101,0,109,95,99,111,108,108,105,115,105,
|
||||||
84,121,112,101,0,42,109,95,117,115,101,114,79,98,106,101,99,116,80,111,
|
111,110,70,108,97,103,115,0,109,95,105,115,108,97,110,100,84,97,103,49,
|
||||||
105,110,116,101,114,0,109,95,104,105,116,70,114,97,99,116,105,111,110,0,
|
0,109,95,99,111,109,112,97,110,105,111,110,73,100,0,109,95,97,99,116,
|
||||||
109,95,99,99,100,83,119,101,112,116,83,112,104,101,114,101,82,97,100,105,
|
105,118,97,116,105,111,110,83,116,97,116,101,49,0,109,95,100,101,97,99,
|
||||||
117,115,0,109,95,99,99,100,77,111,116,105,111,110,84,104,114,101,115,104,
|
116,105,118,97,116,105,111,110,84,105,109,101,0,109,95,102,114,105,99,116,
|
||||||
111,108,100,0,109,95,99,104,101,99,107,67,111,108,108,105,100,101,87,105,
|
105,111,110,0,109,95,114,101,115,116,105,116,117,116,105,111,110,0,109,95,
|
||||||
116,104,0,109,95,99,111,108,108,105,115,105,111,110,79,98,106,101,99,116,
|
105,110,116,101,114,110,97,108,84,121,112,101,0,42,109,95,117,115,101,114,
|
||||||
68,97,116,97,0,109,95,105,110,118,73,110,101,114,116,105,97,84,101,110,
|
79,98,106,101,99,116,80,111,105,110,116,101,114,0,109,95,104,105,116,70,
|
||||||
115,111,114,87,111,114,108,100,0,109,95,108,105,110,101,97,114,86,101,108,
|
114,97,99,116,105,111,110,0,109,95,99,99,100,83,119,101,112,116,83,112,
|
||||||
111,99,105,116,121,0,109,95,97,110,103,117,108,97,114,86,101,108,111,99,
|
104,101,114,101,82,97,100,105,117,115,0,109,95,99,99,100,77,111,116,105,
|
||||||
105,116,121,0,109,95,105,110,118,101,114,115,101,77,97,115,115,0,109,95,
|
111,110,84,104,114,101,115,104,111,108,100,0,109,95,99,104,101,99,107,67,
|
||||||
97,110,103,117,108,97,114,70,97,99,116,111,114,0,109,95,108,105,110,101,
|
111,108,108,105,100,101,87,105,116,104,0,109,95,99,111,108,108,105,115,105,
|
||||||
97,114,70,97,99,116,111,114,0,109,95,103,114,97,118,105,116,121,0,109,
|
111,110,79,98,106,101,99,116,68,97,116,97,0,109,95,105,110,118,73,110,
|
||||||
95,103,114,97,118,105,116,121,95,97,99,99,101,108,101,114,97,116,105,111,
|
101,114,116,105,97,84,101,110,115,111,114,87,111,114,108,100,0,109,95,108,
|
||||||
110,0,109,95,105,110,118,73,110,101,114,116,105,97,76,111,99,97,108,0,
|
105,110,101,97,114,86,101,108,111,99,105,116,121,0,109,95,97,110,103,117,
|
||||||
109,95,116,111,116,97,108,70,111,114,99,101,0,109,95,116,111,116,97,108,
|
108,97,114,86,101,108,111,99,105,116,121,0,109,95,105,110,118,101,114,115,
|
||||||
84,111,114,113,117,101,0,109,95,108,105,110,101,97,114,68,97,109,112,105,
|
101,77,97,115,115,0,109,95,97,110,103,117,108,97,114,70,97,99,116,111,
|
||||||
110,103,0,109,95,97,110,103,117,108,97,114,68,97,109,112,105,110,103,0,
|
114,0,109,95,108,105,110,101,97,114,70,97,99,116,111,114,0,109,95,103,
|
||||||
109,95,97,100,100,105,116,105,111,110,97,108,68,97,109,112,105,110,103,0,
|
114,97,118,105,116,121,0,109,95,103,114,97,118,105,116,121,95,97,99,99,
|
||||||
109,95,97,100,100,105,116,105,111,110,97,108,68,97,109,112,105,110,103,70,
|
101,108,101,114,97,116,105,111,110,0,109,95,105,110,118,73,110,101,114,116,
|
||||||
97,99,116,111,114,0,109,95,97,100,100,105,116,105,111,110,97,108,76,105,
|
105,97,76,111,99,97,108,0,109,95,116,111,116,97,108,70,111,114,99,101,
|
||||||
110,101,97,114,68,97,109,112,105,110,103,84,104,114,101,115,104,111,108,100,
|
0,109,95,116,111,116,97,108,84,111,114,113,117,101,0,109,95,108,105,110,
|
||||||
83,113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,65,110,103,117,
|
101,97,114,68,97,109,112,105,110,103,0,109,95,97,110,103,117,108,97,114,
|
||||||
108,97,114,68,97,109,112,105,110,103,84,104,114,101,115,104,111,108,100,83,
|
68,97,109,112,105,110,103,0,109,95,97,100,100,105,116,105,111,110,97,108,
|
||||||
113,114,0,109,95,97,100,100,105,116,105,111,110,97,108,65,110,103,117,108,
|
68,97,109,112,105,110,103,0,109,95,97,100,100,105,116,105,111,110,97,108,
|
||||||
97,114,68,97,109,112,105,110,103,70,97,99,116,111,114,0,109,95,108,105,
|
68,97,109,112,105,110,103,70,97,99,116,111,114,0,109,95,97,100,100,105,
|
||||||
110,101,97,114,83,108,101,101,112,105,110,103,84,104,114,101,115,104,111,108,
|
116,105,111,110,97,108,76,105,110,101,97,114,68,97,109,112,105,110,103,84,
|
||||||
100,0,109,95,97,110,103,117,108,97,114,83,108,101,101,112,105,110,103,84,
|
104,114,101,115,104,111,108,100,83,113,114,0,109,95,97,100,100,105,116,105,
|
||||||
104,114,101,115,104,111,108,100,0,0,0,0,84,89,80,69,21,0,0,0,
|
111,110,97,108,65,110,103,117,108,97,114,68,97,109,112,105,110,103,84,104,
|
||||||
99,104,97,114,0,117,99,104,97,114,0,115,104,111,114,116,0,117,115,104,
|
114,101,115,104,111,108,100,83,113,114,0,109,95,97,100,100,105,116,105,111,
|
||||||
111,114,116,0,105,110,116,0,108,111,110,103,0,117,108,111,110,103,0,102,
|
110,97,108,65,110,103,117,108,97,114,68,97,109,112,105,110,103,70,97,99,
|
||||||
108,111,97,116,0,100,111,117,98,108,101,0,118,111,105,100,0,98,116,83,
|
116,111,114,0,109,95,108,105,110,101,97,114,83,108,101,101,112,105,110,103,
|
||||||
99,97,108,97,114,0,80,111,105,110,116,101,114,65,114,114,97,121,0,98,
|
84,104,114,101,115,104,111,108,100,0,109,95,97,110,103,117,108,97,114,83,
|
||||||
116,80,104,121,115,105,99,115,83,121,115,116,101,109,0,76,105,115,116,66,
|
108,101,101,112,105,110,103,84,104,114,101,115,104,111,108,100,0,0,0,0,
|
||||||
97,115,101,0,98,116,86,101,99,116,111,114,51,68,97,116,97,0,98,116,
|
84,89,80,69,22,0,0,0,99,104,97,114,0,117,99,104,97,114,0,115,
|
||||||
77,97,116,114,105,120,51,120,51,68,97,116,97,0,98,116,84,114,97,110,
|
104,111,114,116,0,117,115,104,111,114,116,0,105,110,116,0,108,111,110,103,
|
||||||
115,102,111,114,109,68,97,116,97,0,98,116,67,111,108,108,105,115,105,111,
|
0,117,108,111,110,103,0,102,108,111,97,116,0,100,111,117,98,108,101,0,
|
||||||
110,83,104,97,112,101,68,97,116,97,0,98,116,67,111,110,118,101,120,73,
|
118,111,105,100,0,98,116,83,99,97,108,97,114,0,80,111,105,110,116,101,
|
||||||
110,116,101,114,110,97,108,83,104,97,112,101,68,97,116,97,0,98,116,67,
|
114,65,114,114,97,121,0,98,116,80,104,121,115,105,99,115,83,121,115,116,
|
||||||
111,108,108,105,115,105,111,110,79,98,106,101,99,116,68,97,116,97,0,98,
|
101,109,0,76,105,115,116,66,97,115,101,0,98,116,86,101,99,116,111,114,
|
||||||
116,82,105,103,105,100,66,111,100,121,68,97,116,97,0,0,84,76,69,78,
|
51,68,97,116,97,0,98,116,77,97,116,114,105,120,51,120,51,68,97,116,
|
||||||
1,0,1,0,2,0,2,0,4,0,4,0,4,0,4,0,8,0,0,0,
|
97,0,98,116,84,114,97,110,115,102,111,114,109,68,97,116,97,0,98,116,
|
||||||
4,0,12,0,36,0,8,0,16,0,48,0,64,0,12,0,52,0,-8,0,
|
67,111,108,108,105,115,105,111,110,83,104,97,112,101,68,97,116,97,0,98,
|
||||||
-32,1,0,0,83,84,82,67,10,0,0,0,11,0,3,0,4,0,0,0,
|
116,67,111,110,118,101,120,73,110,116,101,114,110,97,108,83,104,97,112,101,
|
||||||
4,0,1,0,9,0,2,0,12,0,3,0,11,0,3,0,11,0,4,0,
|
68,97,116,97,0,98,116,77,117,108,116,105,83,112,104,101,114,101,83,104,
|
||||||
11,0,5,0,13,0,2,0,9,0,6,0,9,0,7,0,14,0,1,0,
|
97,112,101,68,97,116,97,0,98,116,67,111,108,108,105,115,105,111,110,79,
|
||||||
10,0,8,0,15,0,1,0,14,0,9,0,16,0,2,0,15,0,10,0,
|
98,106,101,99,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,
|
||||||
14,0,11,0,17,0,3,0,9,0,12,0,4,0,13,0,0,0,14,0,
|
121,68,97,116,97,0,0,0,84,76,69,78,1,0,1,0,2,0,2,0,
|
||||||
18,0,5,0,17,0,15,0,14,0,16,0,14,0,17,0,10,0,18,0,
|
4,0,4,0,4,0,4,0,8,0,0,0,4,0,12,0,36,0,8,0,
|
||||||
0,0,14,0,19,0,23,0,16,0,19,0,16,0,20,0,14,0,21,0,
|
16,0,48,0,64,0,12,0,52,0,68,0,-8,0,-32,1,83,84,82,67,
|
||||||
14,0,22,0,14,0,23,0,4,0,24,0,10,0,25,0,9,0,26,0,
|
11,0,0,0,11,0,3,0,4,0,0,0,4,0,1,0,9,0,2,0,
|
||||||
9,0,27,0,17,0,28,0,4,0,29,0,4,0,30,0,4,0,31,0,
|
12,0,3,0,11,0,3,0,11,0,4,0,11,0,5,0,13,0,2,0,
|
||||||
4,0,32,0,10,0,33,0,10,0,34,0,10,0,35,0,4,0,36,0,
|
9,0,6,0,9,0,7,0,14,0,1,0,10,0,8,0,15,0,1,0,
|
||||||
9,0,37,0,10,0,38,0,10,0,39,0,10,0,40,0,4,0,41,0,
|
14,0,9,0,16,0,2,0,15,0,10,0,14,0,11,0,17,0,3,0,
|
||||||
20,0,21,0,19,0,42,0,15,0,43,0,14,0,44,0,14,0,45,0,
|
9,0,12,0,4,0,13,0,0,0,14,0,18,0,5,0,17,0,15,0,
|
||||||
10,0,46,0,14,0,47,0,14,0,48,0,14,0,49,0,14,0,50,0,
|
14,0,16,0,14,0,17,0,10,0,18,0,0,0,14,0,19,0,5,0,
|
||||||
14,0,51,0,14,0,52,0,14,0,53,0,10,0,54,0,10,0,55,0,
|
18,0,19,0,14,0,20,0,10,0,21,0,4,0,22,0,4,0,23,0,
|
||||||
4,0,56,0,10,0,57,0,10,0,58,0,10,0,59,0,10,0,60,0,
|
20,0,23,0,16,0,24,0,16,0,25,0,14,0,26,0,14,0,27,0,
|
||||||
10,0,61,0,10,0,62,0,};
|
14,0,28,0,4,0,29,0,10,0,30,0,9,0,31,0,9,0,32,0,
|
||||||
|
17,0,33,0,4,0,34,0,4,0,35,0,4,0,36,0,4,0,37,0,
|
||||||
|
10,0,38,0,10,0,39,0,10,0,40,0,4,0,41,0,9,0,42,0,
|
||||||
|
10,0,43,0,10,0,44,0,10,0,45,0,4,0,46,0,21,0,21,0,
|
||||||
|
20,0,47,0,15,0,48,0,14,0,49,0,14,0,50,0,10,0,51,0,
|
||||||
|
14,0,52,0,14,0,53,0,14,0,54,0,14,0,55,0,14,0,56,0,
|
||||||
|
14,0,57,0,14,0,58,0,10,0,59,0,10,0,60,0,4,0,61,0,
|
||||||
|
10,0,62,0,10,0,63,0,10,0,64,0,10,0,65,0,10,0,66,0,
|
||||||
|
10,0,67,0,};
|
||||||
int sBulletDNAlen= sizeof(sBulletDNAstr);
|
int sBulletDNAlen= sizeof(sBulletDNAstr);
|
||||||
|
|||||||
@@ -38,17 +38,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
///Allow to serialize data in a chunk format
|
|
||||||
class btSerializer
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
virtual ~btSerializer() {}
|
|
||||||
|
|
||||||
virtual btChunk* allocate(size_t size,int numElements) = 0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#define BT_HEADER_LENGTH 12
|
#define BT_HEADER_LENGTH 12
|
||||||
#if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__BIG_ENDIAN__)
|
#if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__BIG_ENDIAN__)
|
||||||
@@ -61,6 +50,7 @@ class btSerializer
|
|||||||
#define BT_RIGIDBODY_CODE MAKE_ID('R','B','D','Y')
|
#define BT_RIGIDBODY_CODE MAKE_ID('R','B','D','Y')
|
||||||
#define BT_BOXSHAPE_CODE MAKE_ID('B','O','X','S')
|
#define BT_BOXSHAPE_CODE MAKE_ID('B','O','X','S')
|
||||||
#define BT_SHAPE_CODE MAKE_ID('S','H','A','P')
|
#define BT_SHAPE_CODE MAKE_ID('S','H','A','P')
|
||||||
|
#define BT_VECTOR3_CODE MAKE_ID('V','E','C','3')
|
||||||
|
|
||||||
class btDefaultSerializer
|
class btDefaultSerializer
|
||||||
{
|
{
|
||||||
@@ -155,7 +145,7 @@ public:
|
|||||||
btChunk* chunk = (btChunk*)ptr;
|
btChunk* chunk = (btChunk*)ptr;
|
||||||
chunk->m_chunkCode = 0;
|
chunk->m_chunkCode = 0;
|
||||||
chunk->m_oldPtr = data;
|
chunk->m_oldPtr = data;
|
||||||
chunk->m_length = size;
|
chunk->m_length = size*numElements;
|
||||||
chunk->m_number = numElements;
|
chunk->m_number = numElements;
|
||||||
|
|
||||||
m_chunkPtrs.push_back(chunk);
|
m_chunkPtrs.push_back(chunk);
|
||||||
|
|||||||
Reference in New Issue
Block a user