Hi,
As this is my first post, let me first say how fantastic both the Bullet library is and its integration into Blender. I've spent the last few months trying to work out which set of tools and libraries to use for my next (hopefully console) game - and this is definitely it!
What I'm trying to do at the moment is use Blender to create a set of standard physics objects for my game, which I can then hand over to the artists to a) make pretty and b) make game levels.
While they're busy doing that stuff I'm going to be building a cross platform engine (starting with XNA, then moving across to Java for PC/Mac and C++ for DS/Wii etc).
So, I can easily export all the objects in a scene as a .X file, I have a nice Python script to export all the object info as a text file (which I'm about to extend to include all the Sensors and stuff), but how do I map all the physics information onto Bullet API calls?
For example - I have an object with a Near sensor (it's a Fan). If something comes near it, it gets blown away from the fan. Is there a 1:1 mapping between the Near sensor and something in the Bullet API...?
I suppose I could go through the Blender source and see how it all works, but I'm hoping someone will say "yes, it's dead easy - here's a page on how to do it"
Many thanks,
Oaf
Convert Blender physics to Bullet API calls
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: Convert Blender physics to Bullet API calls
Blender and Bullet both support COLLADA Physics, so most properties are exported from Blender COLLADA 1.4 exporter, and imported using Bullet COLLADA Importer (see Bullet/Demos/ColladaDemo).Oaf wrote: So, I can easily export all the objects in a scene as a .X file, I have a nice Python script to export all the object info as a text file (which I'm about to extend to include all the Sensors and stuff), but how do I map all the physics information onto Bullet API calls?
There is a wrapper to provide sensors on top of the regular Bullet API. Please check out blender\source\gameengine\Physics\Bullet\CcdPhysicsEnvironment.cppFor example - I have an object with a Near sensor (it's a Fan). If something comes near it, it gets blown away from the fan. Is there a 1:1 mapping between the Near sensor and something in the Bullet API...?
Hope this helps,
Erwin
-
- Posts: 7
- Joined: Sun Jun 10, 2007 7:40 pm
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
-
- Posts: 7
- Joined: Sun Jun 10, 2007 7:40 pm
-
- Posts: 7
- Joined: Sun Jun 10, 2007 7:40 pm
Playing with the Collada exporter further, it seems it doesn't record half the data anyway; I've just loaded my .DAE back into Blender and all the sensors, etc aren't there.
No worries, I'll just have to write a Python script to export the physics info, then map the settings to Bullet calls myself. At least I know it'll work properly that way
I'll probably post up the script and XNA import code somewhere once I'm done.
No worries, I'll just have to write a Python script to export the physics info, then map the settings to Bullet calls myself. At least I know it'll work properly that way
I'll probably post up the script and XNA import code somewhere once I'm done.