Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7597 in orxonox.OLD for branches/cd/src/lib


Ignore:
Timestamp:
May 11, 2006, 5:34:14 PM (19 years ago)
Author:
patrick
Message:

cd: plane forumula reformulated since there was a small bug in it.

Location:
branches/cd/src/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/cd/src/lib/collision_detection/obb_tree_node.cc

    r7590 r7597  
    120120  this->calculateBoxCovariance(*this->bvElement, modelInf, triangleIndexes, length);
    121121  this->calculateBoxEigenvectors(*this->bvElement, modelInf, triangleIndexes, length);
    122   this->calculateBoxAxis(*this->bvElement, modelInf, triangleIndexes, length);
    123   this->calculateBoxAxis(*this->bvElement, modelInf, triangleIndexes, length);
     122//   this->calculateBoxAxis(*this->bvElement, modelInf, triangleIndexes, length);
     123//   this->calculateBoxAxis(*this->bvElement, modelInf, triangleIndexes, length);
    124124  this->calculateBoxAxis(*this->bvElement, modelInf, triangleIndexes, length);
    125125
     
    365365    box.halfLength[i] = (maxLength[i] - minLength[i]) / 2.0f;                 // min length is negative
    366366  }
     367
    367368  // FIXME: += anstatt -= ????????? verwirr
    368   box.center.x += centerOffset[0];
    369   box.center.y += centerOffset[1];
    370   box.center.z += centerOffset[2];
     369  box.center.x -= centerOffset[0];
     370  box.center.y -= centerOffset[1];
     371  box.center.z -= centerOffset[2];
    371372
    372373  PRINTF(3)("\n");
  • branches/cd/src/lib/math/plane.cc

    r7589 r7597  
    268268{
    269269  n = (a-b).cross(c-b);
    270   k = -(n.x*b.x+n.y*b.y+n.z*b.z);
     270  k = n.dot(a) / n.len();
    271271}
    272272
     
    279279{
    280280  n = norm;
    281   k = -(n.x*p.x+n.y*p.y+n.z*p.z);
     281  k = n.dot(p) / n.len();
    282282}
    283283
     
    292292  Vector p(g[0], g[1], g[2]);
    293293  n = norm;
    294   k = -(n.x*p.x+n.y*p.y+n.z*p.z);
     294  k = n.dot(p) / n.len();
    295295}
    296296
     
    316316  float l = n.len();
    317317  if( l == 0.0) return 0.0;
    318   return (n.dot(p) + k) / n.len();
     318  return (n.dot(p) / n.len() - k);
    319319}
    320320
     
    342342{
    343343  Vector s(p[0], p[1], p[2]);
     344
    344345  float l = n.len();
    345346  if( l == 0.0) return 0.0;
    346   return (n.dot(s) /*+ k*/) / n.len();
     347  return (n.dot(s) / n.len() - k);
    347348}
    348349
Note: See TracChangeset for help on using the changeset viewer.