I have made 2 versions (well... I broke one as it is saved too late past the conversion process to the other) of some 3D collison/zone detection math using RBB [rotated bounding box] based on the separating axis theorem.
One version uses entirely FIXED data types. It generates non-zero numbers, but there are overflows due to numbers being squared (600 squared, for instance, is beyond the range of FIXED data).
One version (that can compile) I made to combat the overflows is programmed using jo_vectorf and Sint32 values and should make the final conclusion more likely/less buggy (removal of decimal points in end comparison). But there is a problem... all the numbers are zero, and I don't know why. All of the math up to slInnerProduct (replaced with jo_vectorf_dot) and JO_SQUARE (being the overflow area) worked previously, now it doesn't work at all. At some point I had that same math working with jo_vectorf and Sint32 data, but jo_vectorf_dot would not operate since this was a situation in which the vectors were not stored as pointers (and instead "stack variables" or you know, missing the * in jo_vectorf *vector_here_is_pointer_with_star ).
And the other factoid, if I remove the initialization from jo_vectorf structs, it crashes.
Here is the jo_vectorf (float/int) code that I am trying to use:
http://www.mediafire.com/file/q9xmx8cd06c2666/bounder.cHere, for comparison, is the (broken) more-SGL-reliant code:
http://www.mediafire.com/file/kwbr3kb5xa01u3c/bounder_broke.cThank you for reading.
The answer is probably simple. Maybe I am trying to typecast something wrong or am using jo_float2fixed and/or toFIXED improperly.
and here's the entire project
http://www.mediafire.com/file/nypbx88obigj3x7/RTFK.zip/e: thread has a conclusion
http://www.mediafire.com/file/do4493rxrmyqk59/bounder_share.c