Changeset 4668 in orxonox.OLD for orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
- Timestamp:
- Jun 23, 2005, 6:10:42 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
r4661 r4668 451 451 452 452 /* calculate the real centre of the body by using the axis length */ 453 float center [3];454 float offset[3];453 float centerOffset[3]; 454 float newHalfLength[3]; 455 455 for(int i = 0; i < 3; ++i) 456 456 { 457 457 PRINTF(0)("max: %f, min: %f \n", maxLength[i], minLength[i]); 458 center [i] = (maxLength[i] - minLength[i]) / 2.0f; // min length is negative459 offset[i] = halfLength[i] - center[i];458 centerOffset[i] = (maxLength[i] + minLength[i]) / 2.0f; // min length is negatie 459 newHalfLength[i] = (maxLength[i] - minLength[i]) / 2.0f; // min length is negative 460 460 //PRINTF(0)("Center Orig: %f, %f, %f ---- new: %f, %f, %f", box->center[]); 461 *box->center += (box->axis[i] * offset[i]); // update the new center vector462 PRINTF(0)("Center Translation Operation: halfLength old: %f, new: %f\n", halfLength[i], center[i]);463 halfLength[i] = center[i];461 *box->center += (box->axis[i] * centerOffset[i]); // update the new center vector 462 //PRINTF(0)("Center Translation Operation: halfLength old: %f, new: %f\n", halfLength[i], center[i]); 463 halfLength[i] = newHalfLength[i]; 464 464 } 465 465
Note: See TracChangeset
for help on using the changeset viewer.