Jan's advice is sound.

For use with Bullet and osgBullet, ideally each Geode (or maybe Geometry)
should be a convex object. If so, osgBullet can be used to create a Bullet
compound shape for the entire model, consisting of sub-shapes that are all
simple convex shapes.

Bullet does not support concave collision shapes, to my knowledge. But you
can emulate a concave shape by creating a compound shape consisting of
convex sub-shapes.

You mentioned cow.osg. Just FYI, the osgBullet examples that use that model
create a btConvexHull collision shape, I think -- that is a convex mesh of
triangles around the model. But, as Jan said, triangle meshes are very
slow. The parameterized convex shapes (sphere, box, cylinder) are much more
efficient.

What you might want to do with cow.osg is create a convex shape for each of
its parts (four cylinders for the legs, a larger cylinder for the torso,
etc.). But you would have to model this manually. osgBullet can't do this
automatically because all of the cow.osg geometry is inside a single
Geometry object. Bullet contains a convex decomposition implementation, but
the algorithm has limitations.



On Mon, Nov 18, 2013 at 6:27 AM, Jan Ciger <[email protected]> wrote:

>
>
> On Mon, Nov 18, 2013 at 12:34 PM, Mots G <[email protected]> wrote:
>
>> Thank you Paul and Jan for the explanations!
>>
>>
> You are welcome. BTW, that stuff is also in the Bullet's documentation
> *wink* :)
>
>
>
>> On digging further, I came across a post 
>> (here<http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?t=6816>),
>> which suggested that collision between two "Trimesh:
>> btBvhTriangleMeshShape" does not work with the default dispatcher. It
>> suggests the use of gimpact algorithm and create
>> 'btGImpactConvexDecompositionShape' collision shapes for the osg-geode.
>>
>> I am yet to figure out the correct way to generate a
>> 'btGImpactConvexDecompositionShape' shape for an osg-geode.
>>
>
> Ah yes, this I remember as well. If you can, try to avoid using arbitrary
> meshes for collision testing, because it is slow. Unless you absolutely
> need the accuracy, try to use a bounding volume(s) for it instead - i.e.
> you have one mesh for display and another, simpler one, for collision
> testing. Replacing the complicated non-convex object with a one or more
> spheres, boxes or cylinders does wonders for performance and it is a lot
> simpler than doing the convex decomposition.
>
> Regards,
>
> Jan
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>


-- 
Paul Martz
Skew Matrix Software LLC
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to