Hi Martin,

I don't have an exact answer to your question but I've successfully integrated Bullet and OSG (currently only rigid bodies). Basically you just need two separate threads/worlds: rendering and physics simulation. An osg::NodeCallback retrieves the current MotionState from Bullet per frame and writes it to the osg::PositionAttitudeTransform of the graphical representation of that object. The tricky part is probably the calculation of appropriate collsion-shapes for given meshes. Bullet provides a Demo application, where you can drive and use a ForkLift. It should give you a good starting point.

Cheers
Mathias Buhr

On 06/07/2010 05:54 PM, Martin Naylor wrote:
Hi all,

I have a question regarding the best way to go with implementing physics
into OSG.

Have the osgbuggy example and have ported that to the SVN/trunk versions of
osg/ode which seems a bit long winded way of manually creating the terrain
and vehicle.

How or what is everyone else doing when it comes to physic simulation?

A quick example of what I am trying to achieve is, a vehicle moving along a
mesh terrain and each wheel must articulate to the terrain, guess that is
more of an collision detection question,but the vehicle must also spring up
and down/roll over and the terrain may vary concrete/mud/sand etc..

Could anyone waltz us through how you could possible achieve all of this, do
I use intersectionvisitor instead and compute all my own physics with
callbacks, will that be  expensive on the cpu?

Sorry if it seems a bit dumb, but before trying to achieve all of this I
want to make sure I am singing from the correct hymn sheet J



Cheers



Martin Naylor.








_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to