Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Dec 5, 2005, 12:48:07 AM (19 years ago)
Author:
patrick
Message:

collision_deteciton: some minor bug fixes. the eigenvc algorithm doesn't work yet. this realy sucks…

File:
1 edited

Legend:

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

    r5927 r5929  
    169169
    170170    /* calculate the cetroid of the hull triangles */
    171     centroid[i] = (p + q + r) * 1/3;
     171    centroid[i] = (p + q + r) / 3.0f;
    172172    /* now calculate the centroid of the entire convex hull, weighted average of triangle centroids */
    173173    center += centroid[i] * facelet[i];
     
    193193        r = *tmpVec;
    194194
    195         covariance[j][k] = facelet[i] / (12.0f * face) * (9.0f * centroid[i][j] * centroid[i][k] + p[j] * p[k] +
    196                            q[j] * q[k] + r[j] * r[k]) - center[j] * center[k];
     195        covariance[j][k] = facelet[i] * (9.0f * centroid[i][j] * centroid[i][k] + p[j] * p[k] +
     196                           q[j] * q[k] + r[j] * r[k]);
    197197      }
     198      covariance[j][k] = covariance[j][k] / (12.0f * face) - center[j] * center[k];
    198199    }
    199200  }
     
    248249    for(int k = 0; k < 3; ++k)
    249250    {
    250       PRINT(3)("%11.2f\t", covariance[j][k]);
     251      PRINT(3)("%11.4f\t", covariance[j][k]);
    251252    }
    252253    PRINT(3)("\n");
    253254  }
    254   PRINTF(3)("\nWeighteed OBB Center:\n\t\t%11.2f\t %11.2f\t %11.2f\n", center.x, center.y, center.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);
     255  PRINTF(3)("\nWeighteed OBB Center:\n\t\t%11.4f\t %11.4f\t %11.4f\n", center.x, center.y, center.z);
     256  PRINTF(3)("\nArithmetical OBB Center:\n\t\t%11.4f\t %11.4f\t %11.4f\n", box.arithCenter.x, box.arithCenter.y, box.arithCenter.z);
    256257
    257258  /* write back the covariance matrix data to the object oriented bouning box */
Note: See TracChangeset for help on using the changeset viewer.