Handling Bullet constraints, advice?

View previous topic View next topic Go down

Handling Bullet constraints, advice?

Post  yarri on Sat Apr 18, 2009 11:23 am

Hi, I'm trying to find an elegant way to add Bullet constraints (btHingeConstraint, etc.) to my SIO2 objects. Sanity checking the physics rig in Blender is nice, and so I'm trying to find a programmatic way to transfer pivot points, etc. Any advice? Is anyone using the Physic object properties in a clever way to do this? Or updating sio2_exporter.py?

--yarri

yarri

Posts : 81
Join date : 2009-04-10

View user profile

Back to top Go down

Re: Handling Bullet constraints, advice?

Post  uprise78 on Tue May 12, 2009 9:18 am

Old thread but I'm playing with this right now. I am planning on using the 'user' variables and a custom parser for btHingeConstraint (the most simple, single object one at least). I am still mulling through the Bullet docs and I'm not sure how many others i will need but I would love to have a way to add them from Blender. Did you come up with anything?

uprise78

Posts : 228
Join date : 2008-10-31

View user profile

Back to top Go down

Re: Handling Bullet constraints, advice?

Post  yarri on Tue May 12, 2009 2:28 pm

No code I can share, but I went down the same path as you... I looked into creating a custom Python script that would parse the Blender game engine settings and then apply these to the _SIO2object->_btRigidBody during load time with a custom parser. This way you could avoid any changes to the SIO2 engine. You can find the Blender 2.48 GE python script API, here:
http://www.blender.org/documentation/248PythonDoc/GE/index.html

Please note Blender 2.48 only supports a subset of the Bullet constraints, check to make sure you can do what you want in the Game Engine first:
http://wiki.blender.org/index.php/Doc:Manual/Game_Engine/Python_API/Bullet_physics

--yarri

yarri

Posts : 81
Join date : 2009-04-10

View user profile

Back to top Go down

Re: Handling Bullet constraints, advice?

Post  uprise78 on Tue May 12, 2009 9:01 pm

Thanks for the links yarri. Do you know if there is any way to add a hinge constraint without using an armature in Blender?

uprise78

Posts : 228
Join date : 2008-10-31

View user profile

Back to top Go down

Re: Handling Bullet constraints, advice?

Post  yarri on Wed May 13, 2009 1:16 am

You mean like this?
http://twitpic.com/530h3


I've added a hinge constraint between the "wheel" and "bike" in this scene without any armature using the Object panel, and the Constrains sub-panel.

--yarri

yarri

Posts : 81
Join date : 2009-04-10

View user profile

Back to top Go down

Re: Handling Bullet constraints, advice?

Post  uprise78 on Thu May 14, 2009 6:58 pm

Thanks for the tip yarri. I am working on an exporter now. i got the constraint parser just about done. it will work for hinges and ball and socket i believe if all goes well.

uprise78

Posts : 228
Join date : 2008-10-31

View user profile

Back to top Go down

Re: Handling Bullet constraints, advice?

Post  uprise78 on Sun May 17, 2009 7:05 pm

So, after fiddling around with this for a little while I got hinge exports working. It doesn't feel very useful though so I am going to scrap the whole idea. There are too many inconsistencies with the mapping of Blender to SIO2/Bullet. The only exportable item that makes sense at all is the hinge constraint from the Object -> Constraints panel but even that is wrong. The Y and Z axis are backwards and Bullet it looking for a vector anyway. The only way to export it that I could come up with was axisRotation % 90 / 90 for each (x,y,z) axis. This works fine and all, but then if you want a motor you need to add it to the Physics panel and you need to add a Sensor, Controller and Actuator to get it spinning. I learned a ton doing this so all is not lost. I think I will end up either adding a generic btTypedConstraint object type to the resource manager or just adding btTypedConstraint's to the SIO2object and wrapping the Bullet API for easy access to hinges and generic 6 Dof constraints.

uprise78

Posts : 228
Join date : 2008-10-31

View user profile

Back to top Go down

Re: Handling Bullet constraints, advice?

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum