Hello
Does anyone know how to fix this?
When two cubes are collided (upper-right Y-axis edge of
bottom cube penetrates upper box), contact normal looks correct, but contact
point is generated with Z positive, while it is evident that Z must be less than
zero.
The locations, orientations and dimensions of boxes along
with dCollide() invocation parameters are given below.
516
int iCollisionCount = dCollide(idFirstGeom, idSecondGeom, 1 |
CONTACTS_UNIMPORTANT, &cgCollisionInfo,
sizeof(dContactGeom));
(gdb)
n
517
ASSERTE(IN_RANGE(iCollisionCount, 0, 2));
(gdb) p cgCollisionInfo
$1 =
{pos = {1.70887256, 1.51961505, 1.32111371, -1.54864812}, normal =
{0.98480773, 0, 0.173648179, 1.62065773e-39}, depth =
0.509440064, g1 = 0x8589b18,
g2 = 0x8521d00, side1 = 136585673, side2
= 139570980}
(gdb) p idFirstGeom[0].final_posr[0]
$2 = {pos =
{2.96757913, 0, 0, 0}, R = {0.98480773, 0,
-0.173648179, 0, 0, 1, 0, 0, 0.173648179, 0,
0.98480773, 0}}
(gdb) p ({dxBox}idFirstGeom).side
$3 =
{3.03923011, 3.03923011, 3.03923011, 0}
(gdb) p
idSecondGeom[0].final_posr[0]
$4 = {pos = {0, 0, 0, 0}, R =
{1, 0, 0, 0, 0, 1, 0, 0, 0, 0,
1, 0}}
(gdb) p ({dxBox}idSecondGeom).side
$5 =
{3.41774511, 11.9242125, 11.9242125,
6.31030347e-34}
Oleh Derevenko
-- Yahoo ID: oleh_derevenko
-- ICQ:
36361783