szu
unread,Jun 30, 2011, 9:33:54 AM6/30/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ode-users
i'm attaching the minimal example.
usually this problem is hidden in linux, because of the default fpu
flags that ignore div/0 (my example code adjusts the fpu to make it
fatal in linux, too).
any ideas on how to fix it?
#include <ode/ode.h>
#include <fenv.h>
void rayCallback(void *data, dGeomID o1, dGeomID o2)
{
dContactGeom contact;
if (dCollide(o1,o2,1,&contact,sizeof(dContactGeom)))
printf("contact! %g",contact.depth);
}
int main()
{
feenableexcept(FE_DIVBYZERO);
dInitODE();
dSpaceID space;
dGeomID ray;
dGeomID cyl;
space = dHashSpaceCreate(0);
cyl = dCreateCCylinder (space, 0.1, 1);
dMatrix3 R={0,0,1,0, 1,0,0,0, 0,1,0,0};
dGeomSetPosition(cyl,0,0,0);
dGeomSetRotation(cyl,R);
ray = dCreateRay(space,1);
dGeomRaySet(ray, 0,0,0, 1,0,0);
dSpaceCollide2(ray,(dGeomID)space,0,rayCallback);
dCloseODE();
return 0;
}