Hi,
cpSpaceHash.c 512:
- Code: Select all
cpFloat dt_dx = 1.0f/cpfabs(b.x - a.x), dt_dy = 1.0f/cpfabs(b.y - a.y);
Getting devision on zero.
Do you have any technical agreement about division on zero. Is it legal?
cpFloat dt_dx = 1.0f/cpfabs(b.x - a.x), dt_dy = 1.0f/cpfabs(b.y - a.y);
slembcke wrote:Looks like you are trying to do a zero length segment query.
// fix NANs in horizontal directions
cpFloat next_h = (temp_h ? temp_h*dt_dx : dt_dx);
cpFloat next_v = (temp_v ? temp_v*dt_dy : dt_dy);
It shouldn't be producing any floating point exceptions
cpFloat dx = cpfabs(b.x - a.x), dy = cpfabs(b.y - a.y);
cpFloat dt_dx = (dx ? 1.0f/dx : INFINITY), dt_dy = (dy ? 1.0f/dy : INFINITY);
cpFloat an = cpvdot(a, n);
cpFloat bn = cpvdot(b, n);
cpFloat t = (d - an)/(bn - an);
Users browsing this forum: No registered users and 1 guest