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

Function main

Extras/Serialize/ReadBulletSample/main.cpp:25–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23///the Bullet/Demos/SerializeDemo and Bullet/Serialize/BulletWorldImporter
24
25int main(int argc, char** argv)
26{
27 const char* fileName = "testFile.bullet";
28 bool verboseDumpAllTypes = false;
29
30 bParse::btBulletFile* bulletFile2 = new bParse::btBulletFile(fileName);
31
32 bool ok = (bulletFile2->getFlags() & bParse::FD_OK) != 0;
33
34 if (ok)
35 bulletFile2->parse(verboseDumpAllTypes);
36 else
37 {
38 printf("Error loading file %s.\n", fileName);
39 exit(0);
40 }
41 ok = (bulletFile2->getFlags() & bParse::FD_OK) != 0;
42 if (!ok)
43 {
44 printf("Error parsing file %s.\n", fileName);
45 exit(0);
46 }
47
48 if (verboseDumpAllTypes)
49 {
50 bulletFile2->dumpChunks(bulletFile2->getFileDNA());
51 }
52
53 btBulletDataExtractor extractor;
54
55 extractor.convertAllObjects(bulletFile2);
56
57 delete bulletFile2;
58
59 return 0;
60}

Callers

nothing calls this directly

Calls 6

exitFunction · 0.85
getFlagsMethod · 0.45
parseMethod · 0.45
dumpChunksMethod · 0.45
getFileDNAMethod · 0.45
convertAllObjectsMethod · 0.45

Tested by

no test coverage detected