Thank you Paul and Jan for the explanations! I have checked the collision example that comes with the osgBullet library. I was trying to modify the same example to get collision between two osg-models.
I first modified the CF_KINEMATIC_OBJECT box by an osg mode (Cow.osgt). Collision worked fine with precision between the CF_STATIC_OBJECT Box-geode and the CF_KINEMATIC_OBJECT cow model. I then changed the other CF_STATIC_OBJECT box by another osg model (cessna.osgt) and the collision completely stopped working. 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. I hope I'm on the right track :) Regards, Mots On Mon, Nov 18, 2013 at 5:41 AM, Jan Ciger <[email protected]> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hello, > > On 11/17/2013 06:42 PM, Mots G wrote: > > Hi Paul, I'm confused between static and dynamic objects. Does > > dynamic object mean the rigid body dynamic object and the dynamic > > world? I thought dynamic objects were only needed if I had to get > > inertia and motion states properties to the objects. In my case I > > only need to test if the 3D models collide among themselves so > > their movement(translations etc) could be restricted. > > These the classes objects Bullet is using: > > Static = never moves, doesn't get any collision response (think > landscape or buildings), but other objects hitting it get collisions. > > Dynamic = both moves and gets collision response (i.e. bounces off > when hit), typically most of your mobile objects. > > Kinematic = moves but doesn't get any collision response (it is not > affected by impacts from other objects), but still will participate in > the collision testing (can push away other objects, for example). > Typically used for things that the user is manipulating. This is in > order for the physics engine to not "freak out" because the object is > moving differently than the physics expects it to. > > The reason for this type of division is optimization - e.g. two static > objects never move, thus can never collide with each other and Bullet > doesn't need to calculate such collision. Collision testing can be > very expensive, that's why this optimization is there - to minimize > the amount of calculation to be done. > > If you are getting a static-static collision, that either means that > you haven't set the object type correctly for your moving objects or > that you have two static objects overlapping - typically something > like one piece of static decor (e.g. a building) overlapping another > one (or even the ground!). > > > > > Therefore I was under the impression only the collision library > > (osgbCollision) would suffice my purpose. However I'm still missing > > on something and unable to get it work. > > Bullet doesn't work like that. Even if you are using only the > collision tests and not driving your objects using the physics > simulation, you still must set up the object types correctly. > Otherwise the collision engine will optimize the tests out or even > fail with an error. > > In your case you must set the objects that you are moving as dynamic > (perhaps kinematic) for the collisions to work. They cannot be all static. > > Regards, > > Jan > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.14 (GNU/Linux) > Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ > > iD8DBQFSiTgIn11XseNj94gRAixBAJ9PdzxAypWx4GU4x60gEmeXh27gSwCfZJEL > Mefjrx+3c/ub8uxJeoxB7+8= > =hH53 > -----END PGP SIGNATURE----- > _______________________________________________ > 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

