Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 23, 2005, 6:10:42 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: the cubes have now minimal length

File:
1 edited

Legend:

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

    r4661 r4668  
    451451
    452452   /* 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];
    455455   for(int i = 0; i < 3; ++i)
    456456     {
    457457       PRINTF(0)("max: %f, min: %f \n", maxLength[i], minLength[i]);
    458        center[i] = (maxLength[i] - minLength[i]) / 2.0f; // min length is negative
    459        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
    460460       //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 vector
    462        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];
    464464     }
    465465
Note: See TracChangeset for help on using the changeset viewer.