#139549 - a128 - Fri Sep 07, 2007 11:55 am
While working on a 3d title.....implementing some collision detection.....wondering why this works with float but not with my fixpoint class....I soon dicovered (and just forgot about it..that this could happen)
that the mulf32(a,b) could have overflow
Any cool idea for overflow checks (before the mulf32(a,b) command)?
I would include this for DEBUG purposes.
Overflow happens
BTW here is my fixpoint class
http://a128.atspace.com/fixpoint.tgz
that the mulf32(a,b) could have overflow
Any cool idea for overflow checks (before the mulf32(a,b) command)?
I would include this for DEBUG purposes.
Overflow happens
Code: |
Fixed fDet = abs(fA00 * fA11 - fA01 * fA01); Fixed u1=(fA01 * fB1); /!!!!overflows /* FA01 and fB1 could have larger values because i.e. fA01=x*x+y*y+z*z I check for a very big triangle...because I want to reduce my triangle count for collsion mesh */ |
BTW here is my fixpoint class
http://a128.atspace.com/fixpoint.tgz