Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 20, 2005, 6:47:54 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: center is calculated more precisly now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc

    r4660 r4661  
    392392  for(int j = 0; j < length; ++j)
    393393    {
    394       tmpLength = fabs(p1.distancePoint(vertices[j]));
     394      tmpLength = fabs(p0.distancePoint(vertices[j]));
    395395      if( tmpLength > halfLength[0])
    396396        halfLength[0] = tmpLength;
     
    408408  for(int j = 0; j < length; ++j)
    409409    {
    410       tmpLength = fabs(p1.distancePoint(vertices[j]));
     410      tmpLength = fabs(p2.distancePoint(vertices[j]));
    411411      if( tmpLength > halfLength[2])
    412412        halfLength[2] = tmpLength;
     
    431431   for(int j = 0; j < length; ++j)
    432432   {
    433      tmpLength = p0.distancePoint(vertices[j]);
     433     tmpLength = p1.distancePoint(vertices[j]);
    434434     if( tmpLength > maxLength[1])
    435435       maxLength[1] = tmpLength;
     
    442442   for(int j = 0; j < length; ++j)
    443443   {
    444      tmpLength = p0.distancePoint(vertices[j]);
     444     tmpLength = p2.distancePoint(vertices[j]);
    445445     if( tmpLength > maxLength[2])
    446446       maxLength[2] = tmpLength;
     
    455455   for(int i = 0; i < 3; ++i)
    456456     {
     457       PRINTF(0)("max: %f, min: %f \n", maxLength[i], minLength[i]);
    457458       center[i] = (maxLength[i] - minLength[i]) / 2.0f; // min length is negative
    458459       offset[i] = halfLength[i] - center[i];
Note: See TracChangeset for help on using the changeset viewer.