Page 1 of 1

Best methode to save/load collisiondata

Posted: Fri Aug 31, 2012 7:35 pm
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>

Re: Best methode to save/load collisiondata

Posted: Wed Oct 17, 2012 6:44 pm
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.