Trying to import a .bullet file and use with ninevehgl

fdelossantos
Posts: 1
Joined: Wed Nov 14, 2012 11:03 pm

Trying to import a .bullet file and use with ninevehgl

Post by fdelossantos »

Hi guys,

I exported a .bullet file from blender and would like to import it into my game. I understand I can import the file with the following code:

Code: Select all

btBulletWorldImporter* fileLoader = new btBulletWorldImporter(m_dynamicsWorld);
fileLoader->loadFile("Level1.bullet");
But I'm stuck there and can't find docs explaining how to actually display it on the screen.

Another question I have is, I may have it correct already; Do I initialize my bullet world in the game loop or when application finished loading?


I'm having a pretty tough one wrapping my head around bullet but I'm trying hard. That's a real HARD. Any links to tutorials or docs?


Thanks
MaxDZ8
Posts: 149
Joined: Fri Jun 24, 2011 8:53 am

Re: Trying to import a .bullet file and use with ninevehgl

Post by MaxDZ8 »

fdelossantos wrote:I'm stuck there and can't find docs explaining how to actually display it on the screen.
You don't really. Ok, we want to display it for debugging purposes I guess.
You can find what you need in pretty much every bullet SDK demo. Everything revolves around implementing btIDebugDraw. You then pass this object to btCollisionWorld::setDebugDrawer.
To perform the drawing, you must call btCollisionWorld::debugDrawWorld.
There are also a few settings instructing bullet what to draw. But I cannot pinpoint them right now.
fdelossantos wrote:Another question I have is, I may have it correct already; Do I initialize my bullet world in the game loop or when application finished loading?
I initialize it as a part of loading a "new level" (which is part of the game loop). If memory serves, it is created before graphics resources.
I think creating the world as a result of level load is a rather good solution. I have no idea when exactly "the application finishes loading" as my app has no notion of "finishing loading" in the first place.