.Bullet exporter userPointers

Post Reply
Random#9001
Posts: 10
Joined: Mon Mar 16, 2015 12:59 pm

.Bullet exporter userPointers

Post by Random#9001 »

Hi I am attempting to use bullet physics with irrlicht game engine and I am trying to integrate it for myself because the only wrapper I can find seems outdated.

I'm having problems with exporting .bullet files from blender because although the wiki says it exports name I cant figure out how to access these names. I assumed the names meant whatever I designated the object as in blender and that the names would directly become the user pointers of the object.

This is my code that I am using to test it:

Code: Select all

irrSetUp* worldIrr;
void World::update(){

	for (int i = 0; i < dynamicsWorld->getCollisionObjectArray().size(); i++){
		worldIrr->log((char*)(btCollisionObject*)dynamicsWorld->getCollisionObjectArray()[i]->getUserPointer());
	}


	dynamicsWorld->stepSimulation(1 / 60.f, 10);
}


My output is just a bunch of spaces which I assume means that the userPointer is unfilled. How do I get blender to ezport the names of my objects to userPointers.

I am using irrLicht's ILogger class to output the information into my console.
anthrax11
Posts: 72
Joined: Wed Feb 24, 2010 9:49 pm

Re: .Bullet exporter userPointers

Post by anthrax11 »

The names are stored separately from the collision objects and you can access them via the importer like so:

Code: Select all

btBulletWorldImporter*      m_fileLoader;
...

for (int i = 0; i < dynamicsWorld->getCollisionObjectArray().size(); i++){
    worldIrr->log(m_fileLoader->getNameForPointer(dynamicsWorld->getCollisionObjectArray()[i]));
}
See also:
http://bulletphysics.org/Bullet/phpBB3/ ... php?t=6683
Post Reply