mccdo / osgbullet

Bullet physics and OpenSceneGraph integration
65 stars 34 forks source link

DebugDrawing of btConvexTriMeshCollisionShapeFromOSG and btConvexHullCollisionShapeFromOSG are faulty #24

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use a somewhat complex .osg model
2. load it in and use btConvexTriMeshCollisionShapeFromOSG / 
btConvexHullCollisionShapeFromOSG to create bullet shapes from the osg node
3. create btCollisionObjects and add the shapes to them.
4. Add collisionObjects to a btCollisionWorld.
5. create a osgbCollision::GLDebugDrawer instance.
6. set the debug drawer instance as debugdrawer of the btCollisionWorld instance
7. add the drawer->getSceneGraph to a root of an osg::viewer
8. put the debugdrawing in a simple viewer loop.

What is the expected output? What do you see instead?

the GLDebugDrawer does not even draw a ConvexTriMesh shape (while the objects 
are present in bullet and collidable)

the debug drawn version of the convexHull does not actually draw a hull but 
rather just a full tri-mesh of the model.

What version of the product are you using? On what operating system?
win7 64bit osgw 2.0 + osgb 2.0

Please provide any additional information below.

Both situations assume no explicit osg variation has been loaded and all 
scenegraph information is purely derived from whatever is provided to the 
debugdrawer.

Attached is the code, should be copied into collision.cpp of the Example 
collision.
change std::string complexmodel = "roundabout.osg"; into an concave osg model 
that also has a bunch of internal stuff.

(Feel free to mail, I can provide a model if needed)

Original issue reported on code.google.com by dennis.c...@tassinternational.com on 16 Oct 2013 at 11:01

Attachments:

GoogleCodeExporter commented 9 years ago
Almost forgot to mention:
Also using Bullet 2.79 & OpenSceneGraph 3.0.1

Original comment by dennis.c...@tassinternational.com on 16 Oct 2013 at 11:16

GoogleCodeExporter commented 9 years ago
It would be interesting to know how this behaves in a plain Bullet/OpenGL app 
(leaving OSG and osgBullet out of the loop). I suspect this is a bug in 
btIDebugDraw. GLDebugDrawer is pretty stupid and has no concept of what 
underlying collision shape is being used.

Original comment by SkewMat...@gmail.com on 16 Oct 2013 at 4:00

GoogleCodeExporter commented 9 years ago
could certainly be an issue a bit deeper down the road. I just happened to run 
into it in the current setup :)

Guess it warrants further investigation.

Original comment by dennis.c...@tassinternational.com on 16 Oct 2013 at 8:56