Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5923 in orxonox.OLD for branches/collision_detection/src


Ignore:
Timestamp:
Dec 4, 2005, 11:35:16 PM (19 years ago)
Author:
patrick
Message:

collision_detection: restrucured the center seeker funciton

File:
1 edited

Legend:

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

    r5922 r5923  
    198198    }
    199199  }
     200  for(int i = 0; i < 3; ++i)
     201  {
     202    box.covarianceMatrix[i][0] = covariance[i][0];
     203    box.covarianceMatrix[i][1] = covariance[i][1];
     204    box.covarianceMatrix[i][2] = covariance[i][2];
     205  }
     206  box.center = center;
    200207
    201208
     
    204211  bool                       vertexFound;                               //!< vertex found flag
    205212  Vector                     arithCenter;                               //!< aritmetical center
    206 
    207213
    208214  /* calculate the arithmetical center of the box */
     
    231237    arithCenter += *tmpVec;
    232238  }
    233   arithCenter.debug();
    234239  box.arithCenter = arithCenter / vertIndexVector.size();
    235240
    236241
    237242
    238 
     243  /* debug output section*/
    239244  PRINTF(3)("\nOBB Covariance Matrix:\n");
    240245  for(int j = 0; j < 3; ++j)
     
    248253  }
    249254  PRINTF(3)("\nWeighteed OBB Center:\n\t\t%11.2f\t %11.2f\t %11.2f\n", center.x, center.y, center.z);
    250   PRINTF(3)("\nArithmetical OBB Center:\n\t\t%11.2f\t %11.2f\t %11.2f\n", arithCenter.x, arithCenter.y, arithCenter.z);
     255  PRINTF(3)("\nArithmetical OBB Center:\n\t\t%11.2f\t %11.2f\t %11.2f\n", box.arithCenter.x, box.arithCenter.y, box.arithCenter.z);
    251256
    252257  /* write back the covariance matrix data to the object oriented bouning box */
    253   for(int i = 0; i < 3; ++i)
    254   {
    255     box.covarianceMatrix[i][0] = covariance[i][0];
    256     box.covarianceMatrix[i][1] = covariance[i][1];
    257     box.covarianceMatrix[i][2] = covariance[i][2];
    258   }
    259   box.center = center;
    260258}
    261259
Note: See TracChangeset for help on using the changeset viewer.