Soft body example added to trunk

55 views
Skip to first unread message

Paul Martz

unread,
Feb 27, 2012, 1:12:01 PM2/27/12
to osgbull...@googlegroups.com
Hi all -- For the past couple days, I've been investigating Bullet's soft body
library. The code is quite thick, but I've managed to put together a small
example of a flag waving in the wind. Update svn trunk and see
examples/patch-lowlevel.

The code uses btSoftBodyHelper::CreatePatch() to create a soft body with nodes
that match the geometry of the flag. The flag's osg::Geometry is configured to
use a buffer object with GL_DYNAMIC_DRAW usage. During update, an update
callback copies the soft body node data into the Geometry vertex array, and uses
osgUtil::SmoothingVisitor to generate new normals.

Please try this out and post any feedback.

Note that the name "patch-lowlevel" implies that the example is interacting with
Bullet's API directly. We might decide to add OSG-centric helper classes and
utility functions in the future. If you have any input on this, please post your
ideas.

--
-Paul Martz Skew Matrix Software
http://www.skew-matrix.com/

Reply all
Reply to author
Forward
0 new messages