Best methode to save/load collisiondata

Physics APIs, Physics file formats, Maya, Max, XSI, Cinema 4D, Lightwave, Blender, thinkingParticles™ and other simulation tools, exporters and importers
Post Reply
Zwingling
Posts: 3
Joined: Thu Aug 23, 2012 9:27 pm

Best methode to save/load collisiondata

Post by Zwingling »

I am trying to prefent looping all triangles and add each one to the btTriangleMesh. (Only loading has to be fast, saving speed can be ignored.)
So what is the fastest methode for loading collision data from a file.
How about these two:

1.) Saving a Vertex(bt3Vector)&Index(DWORD) array and on loading just resize the btTriangleMesh and set the data at once.
2.) Using the serializeSingleShape() for saving and for loading somthing like the ReadBulletSample (or init a new btDynamicsWorld, read the file with
the BulletWorldImporter, get the collision object and cleanup the btDynamicsWorld var)

If there are any other methods, please tell me.
The model geometry has these two buffers:
Vertex = vector<float[3]>
Index = vector<DWORD>
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Best methode to save/load collisiondata

Post by Erwin Coumans »

Reading a binary .bullet file is likely fastest. Just use the serialization, either for the entire world, or just for the collision shape.
Post Reply