Creating a COLLADA physics snapshot

From Physics Simulation Wiki

Jump to: navigation, search

Creating a COLLADA Physics snapshot

It is often useful to be able to export a snapshot of an existing Bullet simulation. This is possible and very easy using the BulletColladaConverter. It includes collision objects, rigid bodies and some constraints.

1) Add the following folders to your include search path:


2) Add libxml,libcolladadom, libBulletColladaConverter to your project. Visual Studio developers can add the

Bullet/msvc/x/liblibxml.vcproj and 

projects, and add those to the project dependencies.

3) At the top of your file, include this header file, from Bullet/Extras/BulletColladaConverter.

#include "ColladaConverter.h"

Just before your stepSimulation, or after stepSimulation, insert this code snippet:

static bool justOnce = true;
	if (justOnce)
		justOnce = false;
		ColladaConverter converter(m_physicsWorld);"snapshot.dae"); //store it in the current working directory

That is all. If you want to save the file to the root of c:\ under Windowss, use"file:///c:/test.dae");

If you have an issue, you can zip the .dae file and attach it in a forum issue.

Personal tools