title: Axis Aligned Bounding Box Collision Detection Issue
body: <p>I have attempted to produce an algorithm that uses world coordinates and a bounding box structure to
  detect collision between two bounding boxes. I really don't know what I'm doing, but I thought the code below would work. My issue is that it only detects collision if the bounding boxes are on the exact same x,y,z position.</p>
  
  <pre><code>BOOL AABB::isCollidedWith(AABB* bb)
  {
  if(bb == NULL) return FALSE;
  
  float radX1,radX2;
  float radY1,radY2;
  float radZ1,radZ2;
  
  float arr[12];
  
        //please note that all the mins are set to 0
        //and all the maxes are set to 1
  
  radX1 = (bb-&gt;maxX - bb-&gt;minX) / 2;
  radX2 = (this-&gt;maxX - this-&gt;minX) / 2;
  radY1 = (bb-&gt;maxY - bb-&gt;minY) / 2;
  radY2 = (this-&gt;maxY - this-&gt;minY) / 2;
  radZ1 = (bb-&gt;maxZ - bb-&gt;minZ) / 2;
  radZ2 = (this-&gt;maxZ - this-&gt;minZ) / 2;
  
  //bb coords
  
  arr[1] = bb-&gt;bbX - radX1;
  arr[2] = bb-&gt;bbX + radX1;
  arr[3] = bb-&gt;bbY - radY1;
  arr[4] = bb-&gt;bbY + radY1;
  arr[5] = bb-&gt;bbZ - radZ1;
  arr[6] = bb-&gt;bbZ + radZ1;
  
  //this coords
  arr[7]  = this-&gt;bbX - radX2;
  arr[8]  = this-&gt;bbX + radX2;
  arr[9]  = this-&gt;bbY - radY2;
  arr[10] = this-&gt;bbY + radY2;
  arr[11] = this-&gt;bbZ - radZ2;
  arr[12] = this-&gt;bbZ + radZ2;
  
  if(arr[2] &gt;= arr[7] &amp;&amp; arr[1] &lt;= arr[8])
  {
      if(arr[4] &gt;= arr[9] &amp;&amp; arr[3] &lt;= arr[10])
      {
          if(arr[6] &gt;= arr[11] &amp;&amp; arr[5] &lt;= arr[12])
          {
              this-&gt;collided = TRUE;
              OutputDebugStringA("Collided!\n");
              return TRUE;
          }
      }
  }
  }
  </code></pre>
  
  <p>Structures I am comparing:</p>
  
  <pre><code> AABB* aabb1 = new AABB(0.0f,0.0f,0.0f,1.0f,1.0f,1.0f,0.0f,0.0f,0.0f);
   AABB* aabb2 = new AABB(0.0f,0.0f,0.0f,1.0f,1.0f,1.0f,0.0f,0.0f,0.0f);
   aabb2-&gt;isCollidedWith(aabb1);
  </code></pre>
  
  <p>Constructor snippet :
  Also note that the last three parameters dictate the x,y,z cords of the bounding box</p>
  
  <pre><code>AABB::AABB(float minx,float maxx,float miny,float maxy,float minz,float maxz,float x,float y,float z)
  {
  this-&gt;minX = minx;
  this-&gt;maxX = maxx;
  this-&gt;minY = miny;
  this-&gt;maxY = maxy;
  this-&gt;minZ = minz;
  this-&gt;maxZ = maxz;
  </code></pre>
  
  <p>Any help,criticism, or advice would help.</p>