Menu

#25 AABox/AABox sweep intersection problem

HEAD
open
GMTL (16)
5
2014-10-29
2011-03-22
Anonymous
No

Version: GMTL 0.5.2-1 deb

The attached file demonstrates that the AABox/AABox sweep intersection test returns a false positive if any component of the relative velocity of the two boxes is zero.

Discussion

  • Nobody/Anonymous

    Source file with failing test

     
  • Nobody/Anonymous

    Here's the patch that I am using to correct this problem. Sorry about the formatting -- I don't have a Sourceforge account, so I can't attach files.

    *** Intersection.h.orig 2011-03-22 20:54:30.198177237 -0700
    --- /usr/include/gmtl-0.5.2/gmtl/Intersection.h 2011-03-22 20:54:36.771836476 -0700
    ***************
    *** 152,157 ****
    --- 152,161 ----
    {
    overlap1[i] = (box1.getMin()[i] - box2.getMax()[i]) / path[i];
    }
    + else
    + {
    + return false;
    + }

    if ((box2.getMax()[i] > box1.getMin()[i]) && (path[i] < DATA_TYPE(0)))
    {
    ***************
    *** 161,166 ****
    --- 165,174 ----
    {
    overlap2[i] = (box1.getMax()[i] - box2.getMin()[i]) / path[i];
    }
    + else
    + {
    + return false;
    + }
    }

    // Calculate the first time of overlap

     
  • Nobody/Anonymous

    Eek! I just looked at the patch I added and it is _wrong_. Really wrong. Sorry for the noise. If I come up with a better patch, I'll post it later.

     
  • Patrick Fewell-Hartling

    • milestone: --> HEAD
    • assigned_to: nobody --> patrickh
     
  • Patrick Fewell-Hartling

    The proposed patch causes a test case in the test suite to fail. Specifically, it breaks gmtlTest::IntersectionTest::testIntersectAABoxSweep() (see Test/TestSuite/TestCases/IntersectionTest.cpp). Does that mean that that test is incorrect or that the patch is incorrect?

     
  • Patrick Fewell-Hartling

    Ignore my question. I didn't realize that the bug tracker showed comments in reverse chronological order. I now understand that the proposed change was incorrect.

     

Log in to post a comment.