20#if !defined(__CELLOS_LV2__) && !defined(__MWERKS__)
26#ifdef BT_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
45btBulletFile::btBulletFile()
46 :
bFile(
"",
"BULLET ")
52#ifdef BT_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
79 :
bFile(fileName,
"BULLET ")
85 :
bFile(memoryBuffer, len,
"BULLET ")
135 char* dataPtrHead = 0;
147 if (dataChunk.
dna_nr >= 0)
149 char*
id =
readStruct(dataPtrHead, dataChunk);
232 printf(
"skipping BT_QUANTIZED_BVH_CODE due to broken DNA\n");
260#ifdef BT_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
266 fwrite(&dataChunk,
sizeof(
bChunkInd), 1, fp);
277 fwrite(&dataChunk,
sizeof(
bChunkInd), 1, fp);
288 fwrite(&dataChunk,
sizeof(
bChunkInd), 1, fp);
295 fwrite(&dataChunk,
sizeof(
bChunkInd), 1, fp);
303#ifdef BT_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES
351 mFlags &= ~FD_ENDIAN_SWAP;
353 int littleEndian = 1;
354 littleEndian = ((
char*)&littleEndian)[0];
362 FILE* fp = fopen(fileName,
"wb");
368 endian = ((
char*)&endian)[0];
401 printf(
"Error: cannot open file %s for writing\n", fileName);
410 dataChunk.
code = code;
414 dataChunk.
oldPtr = oldPtr;
421 assert(len == elemBytes);
#define SIZEOFBLENDERHEADER
#define btAlignedFree(ptr)
#define btAlignedAlloc(size, alignment)
#define BT_COLLISIONOBJECT_CODE
#define BT_CONTACTMANIFOLD_CODE
#define BT_TRIANLGE_INFO_MAP
#define BT_QUANTIZED_BVH_CODE
#define BT_RIGIDBODY_CODE
#define BT_DYNAMICSWORLD_CODE
#define BT_CONSTRAINT_CODE
#define BT_MULTIBODY_CODE
#define BT_MB_LINKCOLLIDER_CODE
static int getOffset(int flags)
void init(char *data, int len, bool swap=false)
int getReverseType(short type)
short * getStruct(int ind)
virtual void parseInternal(int verboseMode, char *memDna, int memDnaLength)
btAlignedObjectArray< bChunkInd > m_chunks
btHashMap< btHashPtr, bChunkInd > m_chunkPtrPtrMap
char * readStruct(char *head, class bChunkInd &chunk)
virtual void writeChunks(FILE *fp, bool fixupPointers)
void swapLen(char *dataPtr)
int getNextBlock(bChunkInd *dataChunk, const char *dataPtr, const int flags)
btAlignedObjectArray< bStructHandle * > m_dynamicsWorldInfo
btAlignedObjectArray< bStructHandle * > m_rigidBodies
virtual void parse(int verboseMode)
btAlignedObjectArray< bStructHandle * > m_triangleInfoMaps
btAlignedObjectArray< bStructHandle * > m_bvhs
virtual void addDataBlock(char *dataBlock)
btAlignedObjectArray< bStructHandle * > m_multiBodies
btAlignedObjectArray< bStructHandle * > m_constraints
btAlignedObjectArray< char * > m_dataBlocks
virtual int write(const char *fileName, bool fixupPointers=false)
btAlignedObjectArray< bStructHandle * > m_contactManifolds
btAlignedObjectArray< bStructHandle * > m_collisionObjects
btAlignedObjectArray< bStructHandle * > m_multiBodyLinkColliders
virtual void writeDNA(FILE *fp)
btAlignedObjectArray< bStructHandle * > m_softBodies
btAlignedObjectArray< bStructHandle * > m_collisionShapes
void addStruct(const char *structType, void *data, int len, void *oldPtr, int code)
int size() const
return the number of elements in the array
void push_back(const T &_Val)
void insert(const Key &key, const Value &value)