Changeset 4581 in orxonox.OLD for orxonox/trunk/src/lib/collision_detection
- Timestamp:
- Jun 10, 2005, 3:27:05 AM (20 years ago)
- Location:
- orxonox/trunk/src/lib/collision_detection
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/collision_detection/obb_tree.cc
r4573 r4581 69 69 { 70 70 if( likely(this->rootNode != NULL)) 71 { 71 72 this->rootNode->drawBV(currentDepth, depth); 73 this->rootNode->drawBVPolygon(currentDepth, depth); 74 } 72 75 } 73 76 … … 94 97 /* generate some test vertices */ 95 98 sVec3D* vertList = new sVec3D[3]; 96 sVec3D data[] = {{0.0, 0.0, 0.0},{ 5.0, 0.0, 10.0},{-5.0, 0.0, 10.0}};99 sVec3D data[] = {{0.0, 0.0, 0.0},{10.0, -5.0, 0.0},{10.0, 5.0, 0.0}}; 97 100 98 101 for(int i = 0; i < 3; ++i) -
orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
r4578 r4581 209 209 printf("eigenvector: %f, %f, %f\n", V(1, 3), V(2, 3), V(3, 3)); 210 210 211 box->axis = axis; 211 212 212 213 /* now get the axis length */ … … 229 230 } 230 231 232 box->halfLength = halfLength; 233 231 234 printf("we got length: \n"); 232 235 for(int i = 0; i < 3; ++i) … … 260 263 void OBBTreeNode::drawBV(int currentDepth, const int depth) const 261 264 { 265 glBegin(GL_LINE_LOOP); 262 266 glColor3f(1.0, 1.0, 1.0); 263 glBegin(GL_TRIANGLES);264 267 for(int i = 0; i < this->numOfVertices; ++i) 265 268 { … … 273 276 void OBBTreeNode::drawBVPolygon(int currentDepth, const int depth) const 274 277 { 275 this->bvElement->axis; 276 277 //glBegin(GL_TRIANGLE); 278 //glVertex3f(this->bvElement->center ); 279 //glEnd(); 278 glBegin(GL_LINES); 279 glColor3f(0.0, 0.4, 0.3); 280 glVertex3f(this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z); 281 glVertex3f(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]); 282 283 glVertex3f(this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z); 284 glVertex3f(this->bvElement->axis[1]->x * this->bvElement->halfLength[1], this->bvElement->axis[1]->y * this->bvElement->halfLength[1], this->bvElement->axis[1]->z * this->bvElement->halfLength[1]); 285 286 glVertex3f(this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z); 287 glVertex3f(this->bvElement->axis[2]->x * this->bvElement->halfLength[2], this->bvElement->axis[2]->y * this->bvElement->halfLength[2], this->bvElement->axis[2]->z * this->bvElement->halfLength[2]); 288 289 glEnd(); 280 290 } 281 291
Note: See TracChangeset
for help on using the changeset viewer.