We are currently using version 2.78 of Bullet, and noticed a problem with the serialization / deserialization of bullet objects.
To serialize, we use this kind of code:
Code: Select all
btDefaultSerializer
serializer( maximum_buffer_size );
serializer.startSerialization();
Object->getCollisionShape()->serializeSingleShape( &serializer );
Object->serializeSingleObject( &serializer );
serializer.finishSerialization();
To deserialize, we use the buffer given to us by the serialization, and we use the btBulletWorldImporter class, with its loadFileFromMemory function, and we assign our btRigidBody instance using the getRigidBodyByIndex function. We do this process for each of the instances we have.
The problem we noticed is that some (or all?) of the properties are not properly set after deserialization ( angularFactor for example).
After a quick look in the latest version of bullet, we noticed that you refactored the btBulletWorldImporter class, and that you manually set the friction and the restitution to the rigid bodies in convertAllObjects.
We are wondering if this is a know bug? Or maybe we don't use the correct way to deserialize the buffer we got from the serialization?
Why didn't you choose a symetric way of saving / loading data?