btSphereShape in comp. with btMultiSphereShape and others

mikon
Posts: 6
Joined: Tue Sep 18, 2007 3:15 pm
Location: Germany

btSphereShape in comp. with btMultiSphereShape and others

Post by mikon »

Hi all,
I have several objects:
1. Plane – dimensions are [3, 0.2, 3] (BoxShape)
2. Sphere – radius 0.1 (btConvexTriangleMeshShape)
3. Sphere – radius 0.1 (btMultiSphereShape)
4. Sphere – radius 0.1 (btSphereShape)
5. Box – dimensions are [0.1, 0.1, 0.1] (BoxShape)

I have build several btCollisionWorld-s and added to each only two objects – first one Plane and the second one – one of the another objects. Thus I have got 4 btCollisionWorld-s. I have putted the origin of the first object (plane) in each world to the point [0,-0.2,0] and the origin of the second object to the point [0,0.08,0]. The calculation of penetration depth was performed using performDiscreteCollisionDetection(). The penetration in each case was the same and equal 0.02, but the point_A and point_B returned by getPositionWorldOnA() and getPositionWorldOnB() for the world Plane-Sphere4 were different to others. For each worlds except Plane-Sphere4, I have got something like point_A=[0,0,0] point_B=[0,-0.02,0], but for the btSphereShape I have got point_A=[0,-0.02,0] point_B=[0,0,0].
The question – all worlds was identical, except the type of shape. Why have I got for the world with btSphereShape different results in comparison with others, especially with btMultiSphereShape?

Thx/Brgds
Mikhail Konev
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: btSphereShape in comp. with btMultiSphereShape and others

Post by Erwin Coumans »

The btSphereShape consist entirely of 'collision margin'. All the other shapes (including btBoxShape, btConvexHullShape and btMultiSphereShape) are specified by their default shape with a small (0.04 units by default) collision margin.

Some more wiki documentation should be generated for this, and we need to look into the issue further.
Thanks for reporting!
Erwin