I change the Collision Demo code test the two box collision, I set the two box transform to Identity, the code is:
tr[0].setIdentity();
tr[1].setIdentity();
btVector3 boxHalfExtentsA(1.0000004768371582f,1.0000004768371582f,1.0000001192092896f);
btVector3 boxHalfExtentsB(3.2836332321166992f,3.2836332321166992f,3.2836320400238037f);
btBoxShape* boxA = new btBoxShape(boxHalfExtentsA);
btBoxShape* boxB = new btBoxShape(boxHalfExtentsB);
I run the demo ,the gjkOutput.m_hasResult return false, (the boxA inside boxB), is that right?
the Collision Demo GJKPairDetector return no result
-
- Posts: 1
- Joined: Tue Mar 06, 2007 2:28 pm
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
The CollisionDemo only shows the direct use of GJK. It doesn't pass any penetration depth solver. Therefore it can only measure distance and shallow penetrations (not deeper then the sum of the total collision margin.
You can pass a penetration depth solver as last argument (which is 0 in the demo). You can use another demo like SimpleCollisionDemo or EPAPenDepthDemo to measure penetrations (and distance).
Hope this helps,
Erwin
Code: Select all
btGjkPairDetector convexConvex(shapePtr[0],shapePtr[1],&sGjkSimplexSolver,0);
Hope this helps,
Erwin