btStaticPlaneShape in Houdini-Bullet *UPDATE - Done!*

Physics APIs, Physics file formats, Maya, Max, XSI, Cinema 4D, Lightwave, Blender, thinkingParticles™ and other simulation tools, exporters and importers
Post Reply
goldleaf
Posts: 19
Joined: Fri Nov 20, 2009 6:41 am

btStaticPlaneShape in Houdini-Bullet *UPDATE - Done!*

Post by goldleaf »

I'm trying to get btStaticPlaneShape to work with the Houdini plugin. I've got it working at origin, but I can't move or rotate it. Is this even possible? To get it working, I'm using setEuler() to change the XYZ rotation settings from Houdini into Quaternions (variable 'qtn'), and passing that into the ground's btTransform. Does this look right?

Code: Select all

btDefaultMotionState* groundMotionState = new btDefaultMotionState( btTransform(qtn),btVector3(0,-1,0)));
btRigidBody::btRigidBodyConstructionInfo groundRigidBodyCI(0,groundMotionState,groundShape,btVector3(0,1,0));
btRigidBody* groundRigidBody = new btRigidBody(groundRigidBodyCI);
state->m_dynamicsWorld->addRigidBody(groundRigidBody);
Last edited by goldleaf on Wed Jun 09, 2010 3:45 pm, edited 1 time in total.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: btStaticPlaneShape in Houdini-Bullet

Post by Erwin Coumans »

It should work. You can try setting the world transform of the rigid body directly before adding it to the world:

Code: Select all

btRigidBody* groundRigidBody = new btRigidBody(groundRigidBodyCI);
btTransform tr; tr.setIdenty(); 
// set your own transform here
groundRigidBody->setWorldTransform(tr);
state->m_dynamicsWorld->addRigidBody(groundRigidBody);
Thanks,
Erwin
goldleaf
Posts: 19
Joined: Fri Nov 20, 2009 6:41 am

Re: btStaticPlaneShape in Houdini-Bullet

Post by goldleaf »

Sweet! I'll keep at it, and post here.
goldleaf
Posts: 19
Joined: Fri Nov 20, 2009 6:41 am

Re: btStaticPlaneShape in Houdini-Bullet

Post by goldleaf »

Ground plane now works in the houdini plugin. I realized I was trying to circumvent how bullet shapes were being created via the plugin, and it was really easy to implement when I wasn't trying to redo all of the work myself.

You can get a version of the bullet solver with groundplane support, as well as substeps(done by Seth Holladay), at http://www.gitorious.org/bullet-physics ... ics-solver.

Thanks for the help!
Post Reply