diff --git a/Demos/SerializeDemo/SerializeDemo.cpp b/Demos/SerializeDemo/SerializeDemo.cpp index 582e7e108..8a5a8725b 100644 --- a/Demos/SerializeDemo/SerializeDemo.cpp +++ b/Demos/SerializeDemo/SerializeDemo.cpp @@ -149,6 +149,12 @@ void SerializeDemo::initPhysics() //create a few dynamic rigidbodies // 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 btCylinderShape(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 BOX_SHAPE_PROXYTYPE: case SPHERE_SHAPE_PROXYTYPE: + case MULTI_SPHERE_SHAPE_PROXYTYPE: { btConvexInternalShapeData* bsd = (btConvexInternalShapeData*)shapeData; btVector3 implicitShapeDimensions; @@ -270,6 +277,19 @@ void SerializeDemo::initPhysics() shape = new btCylinderShape(implicitShapeDimensions+margin); 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: { printf("error: cannot create shape type (%d)\n",shapeData->m_shapeType); @@ -287,7 +307,6 @@ void SerializeDemo::initPhysics() } break; } - default: { printf("unsupported shape type (%d)\n",shapeData->m_shapeType); diff --git a/Extras/Serialize/BulletFileLoader/btBulletFile.cpp b/Extras/Serialize/BulletFileLoader/btBulletFile.cpp index c6effbb56..24c140940 100644 --- a/Extras/Serialize/BulletFileLoader/btBulletFile.cpp +++ b/Extras/Serialize/BulletFileLoader/btBulletFile.cpp @@ -93,39 +93,42 @@ void btBulletFile::parseData() // same as (BHEAD+DATA dependancy) dataPtrHead = dataPtr+ChunkUtils::getOffset(mFlags); - char *id = readStruct(dataPtrHead, dataChunk); - - // lookup maps - if (id) + if (dataChunk.dna_nr>=0) { - mLibPointers.insert(dataChunk.oldPtr, (bStructHandle*)id); + char *id = readStruct(dataPtrHead, dataChunk); - m_chunks.push_back(dataChunk); - // block it - //bListBasePtr *listID = mMain->getListBasePtr(dataChunk.code); - //if (listID) - // listID->push_back((bStructHandle*)id); - } + // lookup maps + if (id) + { + mLibPointers.insert(dataChunk.oldPtr, (bStructHandle*)id); - if (dataChunk.code == BT_RIGIDBODY_CODE) - { - m_rigidBodies.push_back((bStructHandle*) id); - } - - if (dataChunk.code == BT_COLLISIONOBJECT_CODE) - { - m_collisionObjects.push_back((bStructHandle*) id); - } + m_chunks.push_back(dataChunk); + // block it + //bListBasePtr *listID = mMain->getListBasePtr(dataChunk.code); + //if (listID) + // listID->push_back((bStructHandle*)id); + } - if (dataChunk.code == BT_SHAPE_CODE) - { - m_collisionShapes.push_back((bStructHandle*) id); - } + if (dataChunk.code == BT_RIGIDBODY_CODE) + { + m_rigidBodies.push_back((bStructHandle*) id); + } + + if (dataChunk.code == BT_COLLISIONOBJECT_CODE) + { + m_collisionObjects.push_back((bStructHandle*) id); + } -// if (dataChunk.code == GLOB) -// { -// m_glob = (bStructHandle*) id; -// } + if (dataChunk.code == BT_SHAPE_CODE) + { + m_collisionShapes.push_back((bStructHandle*) id); + } + + // if (dataChunk.code == GLOB) + // { + // m_glob = (bStructHandle*) id; + // } + } // next please! dataPtr += seek; diff --git a/Extras/Serialize/makesdna/makesdna.cpp b/Extras/Serialize/makesdna/makesdna.cpp index 725484b32..5a0e28e8c 100644 --- a/Extras/Serialize/makesdna/makesdna.cpp +++ b/Extras/Serialize/makesdna/makesdna.cpp @@ -124,6 +124,7 @@ typedef unsigned long uintptr_t; #include "LinearMath/btTransform.h" #include "BulletCollision/CollisionShapes/btCollisionShape.h" #include "BulletCollision/CollisionShapes/btConvexInternalShape.h" +#include "BulletCollision/CollisionShapes/btMultiSphereShape.h" #include "BulletCollision/CollisionDispatch/btCollisionObject.h" #include "BulletDynamics/Dynamics/btRigidBody.h" @@ -146,6 +147,7 @@ char *includefiles[] = { "../../../src/LinearMath/btTransform.h", "../../../src/BulletCollision/CollisionShapes/btCollisionShape.h", "../../../src/BulletCollision/CollisionShapes/btConvexInternalShape.h", + "../../../src/BulletCollision/CollisionShapes/btMultiSphereShape.h", "../../../src/BulletCollision/CollisionDispatch/btCollisionObject.h", "../../../src/BulletDynamics/Dynamics/btRigidBody.h", // empty string to indicate end of includefiles diff --git a/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp b/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp index f7ae52098..f3012b646 100644 --- a/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp +++ b/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp @@ -1267,7 +1267,7 @@ void btCollisionWorld::serializeCollisionObjects(btDefaultSerializer* serializer //serialize all collision shapes int len = shape->calculateSerializeBufferSize(); 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_chunkCode = BT_SHAPE_CODE; chunk->m_oldPtr = shape; diff --git a/src/BulletCollision/CollisionShapes/btCollisionShape.h b/src/BulletCollision/CollisionShapes/btCollisionShape.h index c0dc0977e..5205bf014 100644 --- a/src/BulletCollision/CollisionShapes/btCollisionShape.h +++ b/src/BulletCollision/CollisionShapes/btCollisionShape.h @@ -20,7 +20,7 @@ subject to the following restrictions: #include "LinearMath/btVector3.h" #include "LinearMath/btMatrix3x3.h" #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. @@ -121,7 +121,7 @@ public: virtual int calculateSerializeBufferSize(); ///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) -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; shapeData->m_userPointer = m_userPointer; diff --git a/src/BulletCollision/CollisionShapes/btConvexInternalShape.h b/src/BulletCollision/CollisionShapes/btConvexInternalShape.h index 47c23ce82..ae34b2e48 100644 --- a/src/BulletCollision/CollisionShapes/btConvexInternalShape.h +++ b/src/BulletCollision/CollisionShapes/btConvexInternalShape.h @@ -112,7 +112,7 @@ public: virtual int calculateSerializeBufferSize(); ///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) -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; - btCollisionShape::serialize(&shapeData->m_collisionShapeData); + btCollisionShape::serialize(&shapeData->m_collisionShapeData, serializer); m_implicitShapeDimensions.serialize(shapeData->m_implicitShapeDimensions); m_localScaling.serialize(shapeData->m_localScaling); diff --git a/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp b/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp index f130d30fa..83f428e09 100644 --- a/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp +++ b/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp @@ -18,6 +18,7 @@ subject to the following restrictions: #include "btMultiSphereShape.h" #include "BulletCollision/CollisionShapes/btCollisionMargin.h" #include "LinearMath/btQuaternion.h" +#include "LinearMath/btSerializer.h" btMultiSphereShape::btMultiSphereShape (const btVector3* positions,const btScalar* radi,int numSpheres) :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;im_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"; +} + + diff --git a/src/BulletCollision/CollisionShapes/btMultiSphereShape.h b/src/BulletCollision/CollisionShapes/btMultiSphereShape.h index f1c4cbf34..8673da461 100644 --- a/src/BulletCollision/CollisionShapes/btMultiSphereShape.h +++ b/src/BulletCollision/CollisionShapes/btMultiSphereShape.h @@ -61,8 +61,30 @@ public: 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 diff --git a/src/LinearMath/btSerializer.cpp b/src/LinearMath/btSerializer.cpp index 97a2bd179..7d5a52eda 100644 --- a/src/LinearMath/btSerializer.cpp +++ b/src/LinearMath/btSerializer.cpp @@ -1,5 +1,5 @@ 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, 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, @@ -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, 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, -95,119,111,114,108,100,84,114,97,110,115,102,111,114,109,0,109,95,105,110, -116,101,114,112,111,108,97,116,105,111,110,87,111,114,108,100,84,114,97,110, -115,102,111,114,109,0,109,95,105,110,116,101,114,112,111,108,97,116,105,111, -110,76,105,110,101,97,114,86,101,108,111,99,105,116,121,0,109,95,105,110, -116,101,114,112,111,108,97,116,105,111,110,65,110,103,117,108,97,114,86,101, -108,111,99,105,116,121,0,109,95,97,110,105,115,111,116,114,111,112,105,99, -70,114,105,99,116,105,111,110,0,109,95,104,97,115,65,110,105,115,111,116, -114,111,112,105,99,70,114,105,99,116,105,111,110,0,109,95,99,111,110,116, -97,99,116,80,114,111,99,101,115,115,105,110,103,84,104,114,101,115,104,111, -108,100,0,42,109,95,98,114,111,97,100,112,104,97,115,101,72,97,110,100, -108,101,0,42,109,95,99,111,108,108,105,115,105,111,110,83,104,97,112,101, -0,42,109,95,114,111,111,116,67,111,108,108,105,115,105,111,110,83,104,97, -112,101,0,109,95,99,111,108,108,105,115,105,111,110,70,108,97,103,115,0, -109,95,105,115,108,97,110,100,84,97,103,49,0,109,95,99,111,109,112,97, -110,105,111,110,73,100,0,109,95,97,99,116,105,118,97,116,105,111,110,83, -116,97,116,101,49,0,109,95,100,101,97,99,116,105,118,97,116,105,111,110, -84,105,109,101,0,109,95,102,114,105,99,116,105,111,110,0,109,95,114,101, -115,116,105,116,117,116,105,111,110,0,109,95,105,110,116,101,114,110,97,108, -84,121,112,101,0,42,109,95,117,115,101,114,79,98,106,101,99,116,80,111, -105,110,116,101,114,0,109,95,104,105,116,70,114,97,99,116,105,111,110,0, -109,95,99,99,100,83,119,101,112,116,83,112,104,101,114,101,82,97,100,105, -117,115,0,109,95,99,99,100,77,111,116,105,111,110,84,104,114,101,115,104, -111,108,100,0,109,95,99,104,101,99,107,67,111,108,108,105,100,101,87,105, -116,104,0,109,95,99,111,108,108,105,115,105,111,110,79,98,106,101,99,116, -68,97,116,97,0,109,95,105,110,118,73,110,101,114,116,105,97,84,101,110, -115,111,114,87,111,114,108,100,0,109,95,108,105,110,101,97,114,86,101,108, -111,99,105,116,121,0,109,95,97,110,103,117,108,97,114,86,101,108,111,99, -105,116,121,0,109,95,105,110,118,101,114,115,101,77,97,115,115,0,109,95, -97,110,103,117,108,97,114,70,97,99,116,111,114,0,109,95,108,105,110,101, -97,114,70,97,99,116,111,114,0,109,95,103,114,97,118,105,116,121,0,109, -95,103,114,97,118,105,116,121,95,97,99,99,101,108,101,114,97,116,105,111, -110,0,109,95,105,110,118,73,110,101,114,116,105,97,76,111,99,97,108,0, -109,95,116,111,116,97,108,70,111,114,99,101,0,109,95,116,111,116,97,108, -84,111,114,113,117,101,0,109,95,108,105,110,101,97,114,68,97,109,112,105, -110,103,0,109,95,97,110,103,117,108,97,114,68,97,109,112,105,110,103,0, -109,95,97,100,100,105,116,105,111,110,97,108,68,97,109,112,105,110,103,0, -109,95,97,100,100,105,116,105,111,110,97,108,68,97,109,112,105,110,103,70, -97,99,116,111,114,0,109,95,97,100,100,105,116,105,111,110,97,108,76,105, -110,101,97,114,68,97,109,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,111,110,97,108,65,110,103,117, -108,97,114,68,97,109,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,111,110,97,108,65,110,103,117,108, -97,114,68,97,109,112,105,110,103,70,97,99,116,111,114,0,109,95,108,105, -110,101,97,114,83,108,101,101,112,105,110,103,84,104,114,101,115,104,111,108, -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,0,0,0,0,84,89,80,69,21,0,0,0, -99,104,97,114,0,117,99,104,97,114,0,115,104,111,114,116,0,117,115,104, -111,114,116,0,105,110,116,0,108,111,110,103,0,117,108,111,110,103,0,102, -108,111,97,116,0,100,111,117,98,108,101,0,118,111,105,100,0,98,116,83, -99,97,108,97,114,0,80,111,105,110,116,101,114,65,114,114,97,121,0,98, -116,80,104,121,115,105,99,115,83,121,115,116,101,109,0,76,105,115,116,66, -97,115,101,0,98,116,86,101,99,116,111,114,51,68,97,116,97,0,98,116, -77,97,116,114,105,120,51,120,51,68,97,116,97,0,98,116,84,114,97,110, -115,102,111,114,109,68,97,116,97,0,98,116,67,111,108,108,105,115,105,111, -110,83,104,97,112,101,68,97,116,97,0,98,116,67,111,110,118,101,120,73, -110,116,101,114,110,97,108,83,104,97,112,101,68,97,116,97,0,98,116,67, -111,108,108,105,115,105,111,110,79,98,106,101,99,116,68,97,116,97,0,98, -116,82,105,103,105,100,66,111,100,121,68,97,116,97,0,0,84,76,69,78, -1,0,1,0,2,0,2,0,4,0,4,0,4,0,4,0,8,0,0,0, -4,0,12,0,36,0,8,0,16,0,48,0,64,0,12,0,52,0,-8,0, --32,1,0,0,83,84,82,67,10,0,0,0,11,0,3,0,4,0,0,0, -4,0,1,0,9,0,2,0,12,0,3,0,11,0,3,0,11,0,4,0, -11,0,5,0,13,0,2,0,9,0,6,0,9,0,7,0,14,0,1,0, -10,0,8,0,15,0,1,0,14,0,9,0,16,0,2,0,15,0,10,0, -14,0,11,0,17,0,3,0,9,0,12,0,4,0,13,0,0,0,14,0, -18,0,5,0,17,0,15,0,14,0,16,0,14,0,17,0,10,0,18,0, -0,0,14,0,19,0,23,0,16,0,19,0,16,0,20,0,14,0,21,0, -14,0,22,0,14,0,23,0,4,0,24,0,10,0,25,0,9,0,26,0, -9,0,27,0,17,0,28,0,4,0,29,0,4,0,30,0,4,0,31,0, -4,0,32,0,10,0,33,0,10,0,34,0,10,0,35,0,4,0,36,0, -9,0,37,0,10,0,38,0,10,0,39,0,10,0,40,0,4,0,41,0, -20,0,21,0,19,0,42,0,15,0,43,0,14,0,44,0,14,0,45,0, -10,0,46,0,14,0,47,0,14,0,48,0,14,0,49,0,14,0,50,0, -14,0,51,0,14,0,52,0,14,0,53,0,10,0,54,0,10,0,55,0, -4,0,56,0,10,0,57,0,10,0,58,0,10,0,59,0,10,0,60,0, -10,0,61,0,10,0,62,0,}; +95,99,111,110,118,101,120,73,110,116,101,114,110,97,108,83,104,97,112,101, +68,97,116,97,0,42,109,95,108,111,99,97,108,80,111,115,105,116,105,111, +110,65,114,114,97,121,80,116,114,0,42,109,95,114,97,100,105,65,114,114, +97,121,80,116,114,0,109,95,108,111,99,97,108,80,111,115,105,116,105,111, +110,65,114,114,97,121,83,105,122,101,0,109,95,114,97,100,105,65,114,114, +97,121,83,105,122,101,0,109,95,119,111,114,108,100,84,114,97,110,115,102, +111,114,109,0,109,95,105,110,116,101,114,112,111,108,97,116,105,111,110,87, +111,114,108,100,84,114,97,110,115,102,111,114,109,0,109,95,105,110,116,101, +114,112,111,108,97,116,105,111,110,76,105,110,101,97,114,86,101,108,111,99, +105,116,121,0,109,95,105,110,116,101,114,112,111,108,97,116,105,111,110,65, +110,103,117,108,97,114,86,101,108,111,99,105,116,121,0,109,95,97,110,105, +115,111,116,114,111,112,105,99,70,114,105,99,116,105,111,110,0,109,95,104, +97,115,65,110,105,115,111,116,114,111,112,105,99,70,114,105,99,116,105,111, +110,0,109,95,99,111,110,116,97,99,116,80,114,111,99,101,115,115,105,110, +103,84,104,114,101,115,104,111,108,100,0,42,109,95,98,114,111,97,100,112, +104,97,115,101,72,97,110,100,108,101,0,42,109,95,99,111,108,108,105,115, +105,111,110,83,104,97,112,101,0,42,109,95,114,111,111,116,67,111,108,108, +105,115,105,111,110,83,104,97,112,101,0,109,95,99,111,108,108,105,115,105, +111,110,70,108,97,103,115,0,109,95,105,115,108,97,110,100,84,97,103,49, +0,109,95,99,111,109,112,97,110,105,111,110,73,100,0,109,95,97,99,116, +105,118,97,116,105,111,110,83,116,97,116,101,49,0,109,95,100,101,97,99, +116,105,118,97,116,105,111,110,84,105,109,101,0,109,95,102,114,105,99,116, +105,111,110,0,109,95,114,101,115,116,105,116,117,116,105,111,110,0,109,95, +105,110,116,101,114,110,97,108,84,121,112,101,0,42,109,95,117,115,101,114, +79,98,106,101,99,116,80,111,105,110,116,101,114,0,109,95,104,105,116,70, +114,97,99,116,105,111,110,0,109,95,99,99,100,83,119,101,112,116,83,112, +104,101,114,101,82,97,100,105,117,115,0,109,95,99,99,100,77,111,116,105, +111,110,84,104,114,101,115,104,111,108,100,0,109,95,99,104,101,99,107,67, +111,108,108,105,100,101,87,105,116,104,0,109,95,99,111,108,108,105,115,105, +111,110,79,98,106,101,99,116,68,97,116,97,0,109,95,105,110,118,73,110, +101,114,116,105,97,84,101,110,115,111,114,87,111,114,108,100,0,109,95,108, +105,110,101,97,114,86,101,108,111,99,105,116,121,0,109,95,97,110,103,117, +108,97,114,86,101,108,111,99,105,116,121,0,109,95,105,110,118,101,114,115, +101,77,97,115,115,0,109,95,97,110,103,117,108,97,114,70,97,99,116,111, +114,0,109,95,108,105,110,101,97,114,70,97,99,116,111,114,0,109,95,103, +114,97,118,105,116,121,0,109,95,103,114,97,118,105,116,121,95,97,99,99, +101,108,101,114,97,116,105,111,110,0,109,95,105,110,118,73,110,101,114,116, +105,97,76,111,99,97,108,0,109,95,116,111,116,97,108,70,111,114,99,101, +0,109,95,116,111,116,97,108,84,111,114,113,117,101,0,109,95,108,105,110, +101,97,114,68,97,109,112,105,110,103,0,109,95,97,110,103,117,108,97,114, +68,97,109,112,105,110,103,0,109,95,97,100,100,105,116,105,111,110,97,108, +68,97,109,112,105,110,103,0,109,95,97,100,100,105,116,105,111,110,97,108, +68,97,109,112,105,110,103,70,97,99,116,111,114,0,109,95,97,100,100,105, +116,105,111,110,97,108,76,105,110,101,97,114,68,97,109,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, +111,110,97,108,65,110,103,117,108,97,114,68,97,109,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,111, +110,97,108,65,110,103,117,108,97,114,68,97,109,112,105,110,103,70,97,99, +116,111,114,0,109,95,108,105,110,101,97,114,83,108,101,101,112,105,110,103, +84,104,114,101,115,104,111,108,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,0,0,0,0, +84,89,80,69,22,0,0,0,99,104,97,114,0,117,99,104,97,114,0,115, +104,111,114,116,0,117,115,104,111,114,116,0,105,110,116,0,108,111,110,103, +0,117,108,111,110,103,0,102,108,111,97,116,0,100,111,117,98,108,101,0, +118,111,105,100,0,98,116,83,99,97,108,97,114,0,80,111,105,110,116,101, +114,65,114,114,97,121,0,98,116,80,104,121,115,105,99,115,83,121,115,116, +101,109,0,76,105,115,116,66,97,115,101,0,98,116,86,101,99,116,111,114, +51,68,97,116,97,0,98,116,77,97,116,114,105,120,51,120,51,68,97,116, +97,0,98,116,84,114,97,110,115,102,111,114,109,68,97,116,97,0,98,116, +67,111,108,108,105,115,105,111,110,83,104,97,112,101,68,97,116,97,0,98, +116,67,111,110,118,101,120,73,110,116,101,114,110,97,108,83,104,97,112,101, +68,97,116,97,0,98,116,77,117,108,116,105,83,112,104,101,114,101,83,104, +97,112,101,68,97,116,97,0,98,116,67,111,108,108,105,115,105,111,110,79, +98,106,101,99,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100, +121,68,97,116,97,0,0,0,84,76,69,78,1,0,1,0,2,0,2,0, +4,0,4,0,4,0,4,0,8,0,0,0,4,0,12,0,36,0,8,0, +16,0,48,0,64,0,12,0,52,0,68,0,-8,0,-32,1,83,84,82,67, +11,0,0,0,11,0,3,0,4,0,0,0,4,0,1,0,9,0,2,0, +12,0,3,0,11,0,3,0,11,0,4,0,11,0,5,0,13,0,2,0, +9,0,6,0,9,0,7,0,14,0,1,0,10,0,8,0,15,0,1,0, +14,0,9,0,16,0,2,0,15,0,10,0,14,0,11,0,17,0,3,0, +9,0,12,0,4,0,13,0,0,0,14,0,18,0,5,0,17,0,15,0, +14,0,16,0,14,0,17,0,10,0,18,0,0,0,14,0,19,0,5,0, +18,0,19,0,14,0,20,0,10,0,21,0,4,0,22,0,4,0,23,0, +20,0,23,0,16,0,24,0,16,0,25,0,14,0,26,0,14,0,27,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); diff --git a/src/LinearMath/btSerializer.h b/src/LinearMath/btSerializer.h index 4f6711438..d9105be21 100644 --- a/src/LinearMath/btSerializer.h +++ b/src/LinearMath/btSerializer.h @@ -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 #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_BOXSHAPE_CODE MAKE_ID('B','O','X','S') #define BT_SHAPE_CODE MAKE_ID('S','H','A','P') +#define BT_VECTOR3_CODE MAKE_ID('V','E','C','3') class btDefaultSerializer { @@ -155,7 +145,7 @@ public: btChunk* chunk = (btChunk*)ptr; chunk->m_chunkCode = 0; chunk->m_oldPtr = data; - chunk->m_length = size; + chunk->m_length = size*numElements; chunk->m_number = numElements; m_chunkPtrs.push_back(chunk);