Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4612 in orxonox.OLD for orxonox/trunk/src/lib


Ignore:
Timestamp:
Jun 13, 2005, 12:05:24 AM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: partition the vertices into two different lists

Location:
orxonox/trunk/src/lib/collision_detection
Files:
2 edited

Legend:

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

    r4611 r4612  
    9696
    9797  /* generate some test vertices */
    98   int const length = 3;
     98  int const length = 6;
    9999  sVec3D* vertList = new sVec3D[length];
    100   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}};
     100  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}};
    101101
    102102  for(int i = 0; i < length; ++i)
  • orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc

    r4611 r4612  
    304304  tList<sVec3D>      partition2;                           //!< the vertex partition 2
    305305
     306  for(int i = 0; i < box->numOfVertices; ++i)
     307  {
     308    if( separationPlane.distancePoint(box->vertices[i]) > 0.0f)
     309      partition1.add(&box->vertices[i]);
     310    else
     311      partition2.add(&box->vertices[i]);
     312  }
     313  partition2.add(&box->vertices[vertexIndex]);
     314
     315  printf("\npartition1: got %i vertices/ partition 2: got %i vertices\n", partition1.getSize(), partition2.getSize());
    306316
    307317}
Note: See TracChangeset for help on using the changeset viewer.