Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4659 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
Jun 20, 2005, 1:04:36 AM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: removed some code blocks to get it properly running

File:
1 edited

Legend:

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

    r4658 r4659  
    393393      tmpLength = fabs(p1.distancePoint(vertices[j]));
    394394      if( tmpLength > halfLength[0])
    395         halfLength[0] = tmpLength;
     395        halfLength[0] = tmpLength;
    396396    }
    397397
     
    401401      tmpLength = fabs(p1.distancePoint(vertices[j]));
    402402      if( tmpLength > halfLength[1])
    403         halfLength[1] = tmpLength;
     403        halfLength[1] = tmpLength;
    404404    }
    405405
     
    409409      tmpLength = fabs(p1.distancePoint(vertices[j]));
    410410      if( tmpLength > halfLength[2])
    411         halfLength[2] = tmpLength;
     411        halfLength[2] = tmpLength;
    412412    }
    413413
     
    415415
    416416  /* get the maximal dimensions of the body in all directions */
    417   maxLength[0] = 0.0f;
    418   minLength[0] = 0.0f;
    419   for(int j = 0; j < length; ++j)
    420   {
    421     tmpLength = p0.distancePoint(vertices[j]);
    422     if( tmpLength > maxLength[0])
    423       maxLength[0] = tmpLength;
    424     else if( tmpLength < minLength[0])
    425       minLength[0] = tmpLength;
    426   }
    427 
    428   maxLength[1] = 0.0f;
    429   minLength[1] = 0.0f;
    430   for(int j = 0; j < length; ++j)
    431   {
    432     tmpLength = p0.distancePoint(vertices[j]);
    433     if( tmpLength > maxLength[1])
    434       maxLength[1] = tmpLength;
    435     else if( tmpLength < minLength[1])
    436       minLength[1] = tmpLength;
    437   }
    438 
    439   maxLength[2] = 0.0f;
    440   minLength[2] = 0.0f;
    441   for(int j = 0; j < length; ++j)
    442   {
    443     tmpLength = p0.distancePoint(vertices[j]);
    444     if( tmpLength > maxLength[2])
    445       maxLength[2] = tmpLength;
    446     else if( tmpLength < minLength[2])
    447       minLength[2] = tmpLength;
    448   }
    449 
    450  
    451   /* calculate the real centre of the body by using the axis length */
    452   float center[3];
    453   float offset[3];
    454   for(int i = 0; i < 3; ++i)
    455     {
    456       center[i] = (maxLength[i] - minLength[i]) / 2.0f; // min length is negative
    457       offset[i] = halfLength[i] - center[i];
    458       box->center[i] +=  *box->axis[i] * offset[i];            // update the new center vector
    459       PRINTF(0)("Center Translation Operation: halfLength old: %f, new: %f\n", halfLength[i], center[i]);
    460       halfLength[i] = center[i];
    461     }
    462 
    463  
     417//   maxLength[0] = 0.0f;
     418//   minLength[0] = 0.0f;
     419//   for(int j = 0; j < length; ++j)
     420//   {
     421//     tmpLength = p0.distancePoint(vertices[j]);
     422//     if( tmpLength > maxLength[0])
     423//       maxLength[0] = tmpLength;
     424//     else if( tmpLength < minLength[0])
     425//       minLength[0] = tmpLength;
     426//   }
     427//
     428//   maxLength[1] = 0.0f;
     429//   minLength[1] = 0.0f;
     430//   for(int j = 0; j < length; ++j)
     431//   {
     432//     tmpLength = p0.distancePoint(vertices[j]);
     433//     if( tmpLength > maxLength[1])
     434//       maxLength[1] = tmpLength;
     435//     else if( tmpLength < minLength[1])
     436//       minLength[1] = tmpLength;
     437//   }
     438//
     439//   maxLength[2] = 0.0f;
     440//   minLength[2] = 0.0f;
     441//   for(int j = 0; j < length; ++j)
     442//   {
     443//     tmpLength = p0.distancePoint(vertices[j]);
     444//     if( tmpLength > maxLength[2])
     445//       maxLength[2] = tmpLength;
     446//     else if( tmpLength < minLength[2])
     447//       minLength[2] = tmpLength;
     448//   }
     449//
     450//
     451//   /* calculate the real centre of the body by using the axis length */
     452//   float center[3];
     453//   float offset[3];
     454//   for(int i = 0; i < 3; ++i)
     455//     {
     456//       center[i] = (maxLength[i] - minLength[i]) / 2.0f; // min length is negative
     457//       offset[i] = halfLength[i] - center[i];
     458//       box->center[i] +=  *box->axis[i] * offset[i];            // update the new center vector
     459//       PRINTF(0)("Center Translation Operation: halfLength old: %f, new: %f\n", halfLength[i], center[i]);
     460//       halfLength[i] = center[i];
     461//     }
     462
     463
    464464
    465465  box->halfLength = halfLength;
Note: See TracChangeset for help on using the changeset viewer.