[ODE] Possible TriList Bug, TriCount too high in dCollideSTL
Russ
arrellr at yahoo.com
Thu Feb 20 16:17:02 2003
I'm using ode 0.035 with the old collision system.
Opcode 1.2 and the dTriList that gl posted recently.
I'm dropping a simple composite object, comprised of
four spheres attached to a single body, onto a
TriList.
There are no other bodies in the world. The problem
is in dCollideSTL in the section where it merges
the contacts. The collider works for the first
few bounces (though the bounces do seem a little
weird),
then at some point a penetration occurs that results
in
TriCount and OutTriCount being equal to 5.
In dTriList_Sphere.cpp, shortly after the line:
#ifdef MERGECONTACTS // Merge all contacts into 1
There is a for loop that goes from i=0 to OutTriCount.
At each iteration it grabs a dContactGeom:
dContactGeom* TempContact = CONTACT(Flags, Contacts,
i, Stride);
When i is 3 or 4 the contact it returns is invalid,
specifically:
TempContact->pos[0] == NAN
TempContact->pos[1] == NAN
TempContact->pos[2] == NAN
TempContact->pos[3] == 0.0
TempContact->normal[0] == NAN
TempContact->normal[1] == NAN
TempContact->normal[2] == NAN
TempContact->normal[3] == 0.0
TempContact->depth == -1.07374e+008
NAN == not a number
When this contact is summed into Contact, it's values
become NAN, and these NANs get passed along until
eventually an error message is created by
moveAndRotateBody.
In my callback function I'm setting the maximum number
of contact to be 64 so I don't think that is the
problem. For the particular bounce where this error
occurred the number of contact joints created was 7.
I first traced the error into dInternalStepIsland_x2
where it sums the forces from all the joints
constraints.
Only one of the seven joint constraint forces had NAN
values, and it was only in the torsional component of
cforce.
But I'm pretty sure the error originated in
dCollideSTL.
Any help or advice would be appreciated.
Russ
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/