Handling Bullet constraints, advice?
2 posters
Handling Bullet constraints, advice?
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
yarri- Posts : 81
Join date : 2009-04-10
Re: Handling Bullet constraints, advice?
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
Re: Handling Bullet constraints, advice?
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
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
Re: Handling Bullet constraints, advice?
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
Re: Handling Bullet constraints, advice?
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
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
Re: Handling Bullet constraints, advice?
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
Re: Handling Bullet constraints, advice?
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
Similar topics
» character movement advice
» Need advice regarding Game Programming
» SIO2 Architecture and Bullet Physics integration
» Physics Constraints
» Constraints and soft bodies
» Need advice regarding Game Programming
» SIO2 Architecture and Bullet Physics integration
» Physics Constraints
» Constraints and soft bodies
Permissions in this forum:
You cannot reply to topics in this forum