Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4587 in orxonox.OLD


Ignore:
Timestamp:
Jun 10, 2005, 4:30:00 AM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: to show, that the algorithm works also with more than 3 vertices:), code renicer

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

Legend:

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

    r4586 r4587  
    9696
    9797  /* generate some test vertices */
    98   sVec3D* vertList = new sVec3D[3];
    99   sVec3D data[]  = {{0.0, 0.0, 0.0},{10.0, -5.0, 5.0},{10.0, 5.0, 0.0}};
     98  sVec3D* vertList = new sVec3D[4];
     99  sVec3D data[]  = {{0.0, 0.0, 0.0},{10.0, -5.0, 5.0},{10.0, 5.0, 0.0}, {5.0, 4.0, 1.0}};
    100100
    101101  for(int i = 0; i < 3; ++i)
     
    106106    }
    107107
    108   this->spawnBVTree(1, vertList, 3);
     108  this->spawnBVTree(1, vertList, 4);
    109109
    110110  PRINT(0)("=  Spawning Tree: Finished\n");
  • orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc

    r4586 r4587  
    304304             this->bvElement->center->y + this->bvElement->axis[0]->y * this->bvElement->halfLength[0],
    305305             this->bvElement->center->z + this->bvElement->axis[0]->z * this->bvElement->halfLength[0]);
    306 /*
    307   printf("from center: %f, %f, %f\n", this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z);
    308   printf("to: %f, %f, %f\n\n", this->bvElement->axis[0]->x * this->bvElement->halfLength[0], this->bvElement->axis[0]->y * this->bvElement->halfLength[0], this->bvElement->axis[0]->z * this->bvElement->halfLength[0]);*/
    309306 
    310307  glVertex3f(this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z);
     
    317314             this->bvElement->center->y + this->bvElement->axis[2]->y * this->bvElement->halfLength[2],
    318315             this->bvElement->center->z + this->bvElement->axis[2]->z * this->bvElement->halfLength[2]);
    319  
    320316  glEnd();
    321317}
Note: See TracChangeset for help on using the changeset viewer.