MCPcopy Create free account
hub / github.com/bulletphysics/bullet3 / swap

Method swap

src/Bullet3Serialize/Bullet2FileLoader/b3File.cpp:287–311  ·  view source on GitHub ↗

----------------------------------------------------- //

Source from the content-addressed store, hash-verified

285
286// ----------------------------------------------------- //
287void bFile::swap(char *head, bChunkInd &dataChunk, bool ignoreEndianFlag)
288{
289 char *data = head;
290 short *strc = mFileDNA->getStruct(dataChunk.dna_nr);
291
292 const char s[] = "SoftBodyMaterialData";
293 int szs = sizeof(s);
294 if (strncmp((char *)&dataChunk.code, "ARAY", 4) == 0)
295 {
296 short *oldStruct = mFileDNA->getStruct(dataChunk.dna_nr);
297 char *oldType = mFileDNA->getType(oldStruct[0]);
298 if (strncmp(oldType, s, szs) == 0)
299 {
300 return;
301 }
302 }
303
304 int len = mFileDNA->getLength(strc[0]);
305
306 for (int i = 0; i < dataChunk.nr; i++)
307 {
308 swapStruct(dataChunk.dna_nr, data, ignoreEndianFlag);
309 data += len;
310 }
311}
312
313void bFile::swapLen(char *dataPtr)
314{

Callers 3

b3GrahamScanConvexHull2DFunction · 0.45
removeConstraintByUidMethod · 0.45

Calls 3

getStructMethod · 0.45
getTypeMethod · 0.45
getLengthMethod · 0.45

Tested by

no test coverage detected