Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4661 in orxonox.OLD for orxonox


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

orxonox/trunk: center is calculated more precisly now

Location:
orxonox/trunk/src
Files:
2 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];
  • orxonox/trunk/src/subprojects/collision_detection/collision_detection.cc

    r4647 r4661  
    4545  model->tick(0.1f);
    4646
    47 //   int const length = 6;
    48 //   sVec3D* vertList = new sVec3D[length];
    49 //   sVec3D data[length]  = {{5.0, 0.0, 0.0},{2.0, 0.0, 5.0},{14.0, 0.0, 0.0}, {5.0, 0.0, 1.0}, {12.0, 0.0, 8.0}, {3.0, 5.0, 4.9}};
    50 //
    51 //   for(int i = 0; i < length; ++i)
    52 //   {
    53 //     vertList[i][0] = data[i][0];
    54 //     vertList[i][1] = data[i][1];
    55 //     vertList[i][2] = data[i][2];
    56 //   }
    5747
    5848  CDEngine::getInstance()->debugSpawnTree(9, model->data->pVertices, model->data->numVertices);
Note: See TracChangeset for help on using the changeset viewer.