I want to import a .bullet scene with a lot of rigidbodys from maya : if (!fileLoader->loadFile("manyplanes.bullet"));
Now i want to check the name of each mesh that btCollisionWorld::rayTestSingle hits.
How to get the name of the mesh(rigidbody) from my resultCallback.m_collisionObject ?
thanks in advance
name of a mesh with resultCallback.m_collisionObject
-
- Posts: 5
- Joined: Wed Jun 02, 2010 1:34 pm
-
- Posts: 5
- Joined: Wed Jun 02, 2010 1:34 pm
Re: name of a mesh with resultCallback.m_collisionObject
i tried
but no success - sugestions are very appreciated
Code: Select all
setupEmptyDynamicsWorld();
btBulletWorldImporter* fileLoader = new btBulletWorldImporter(m_dynamicsWorld);
//fileLoader->setVerboseMode(true);
if (!fileLoader->loadFile("manyplanes.bullet"));
int i;
printf("Object Loaded with Name %d\n\n", m_dynamicsWorld->getNumCollisionObjects() );
for (i=m_dynamicsWorld->getNumCollisionObjects()-1; i>=0 ;i--)
{
btCollisionObject* obj = m_dynamicsWorld->getCollisionObjectArray()[i];
btRigidBody* body = btRigidBody::upcast(obj);
const char* meshName = fileLoader->getNameForPointer(obj->getCollisionShape());
printf("Object Loaded with Name %s\n\n", meshName );
}
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA