Changeset 4586 in orxonox.OLD for orxonox/trunk/src/lib/collision_detection
- Timestamp:
- Jun 10, 2005, 4:25:41 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
r4581 r4586 97 97 /* generate some test vertices */ 98 98 sVec3D* vertList = new sVec3D[3]; 99 sVec3D data[] = {{0.0, 0.0, 0.0},{10.0, -5.0, 0.0},{10.0, 5.0, 0.0}};99 sVec3D data[] = {{0.0, 0.0, 0.0},{10.0, -5.0, 5.0},{10.0, 5.0, 0.0}}; 100 100 101 101 for(int i = 0; i < 3; ++i) -
orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
r4585 r4586 205 205 box->axis = axis; 206 206 207 printf("eigenvector: %f, %f, %f\n", V(1, 1), V(2, 1), V(3, 1)); 208 printf("eigenvector: %f, %f, %f\n", V(1, 2), V(2, 2), V(3, 2)); 209 printf("eigenvector: %f, %f, %f\n", V(1, 3), V(2, 3), V(3, 3)); 210 211 box->axis = axis; 212 207 printf("eigenvector: %f, %f, %f\n", box->axis[0]->x, box->axis[0]->y, box->axis[0]->z); 208 printf("eigenvector: %f, %f, %f\n", box->axis[1]->x, box->axis[1]->y, box->axis[1]->z); 209 printf("eigenvector: %f, %f, %f\n", box->axis[2]->x, box->axis[2]->y, box->axis[2]->z); 210 211 213 212 /* now get the axis length */ 214 213 Line ax[3]; //!< the axis … … 251 250 } 252 251 253 254 255 256 // for(int i = 0; i < 3; ++i)257 // {258 // halfLength[i] = 0.0f;259 // for(int j = 0; j < length; ++j)260 // {261 // tmpLength = ax[i].distancePoint(vertices[j]);262 // if( tmpLength > halfLength[i])263 // halfLength[i] = tmpLength;264 // }265 // }266 267 252 box->halfLength = halfLength; 253 254 268 255 269 256 printf("we got length: \n"); 270 257 for(int i = 0; i < 3; ++i) 271 printf("length[%i] = %f\n", i, halfLength[i]);258 printf("length[%i] = %f\n", i, box->halfLength[i]); 272 259 } 273 260 … … 314 301 glColor3f(0.0, 0.4, 0.3); 315 302 glVertex3f(this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z); 316 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]); 317 303 glVertex3f(this->bvElement->center->x + this->bvElement->axis[0]->x * this->bvElement->halfLength[0], 304 this->bvElement->center->y + this->bvElement->axis[0]->y * this->bvElement->halfLength[0], 305 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]);*/ 309 318 310 glVertex3f(this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z); 319 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]); 311 glVertex3f(this->bvElement->center->x + this->bvElement->axis[1]->x * this->bvElement->halfLength[1], 312 this->bvElement->center->y + this->bvElement->axis[1]->y * this->bvElement->halfLength[1], 313 this->bvElement->center->z + this->bvElement->axis[1]->z * this->bvElement->halfLength[1]); 320 314 321 315 glVertex3f(this->bvElement->center->x, this->bvElement->center->y, this->bvElement->center->z); 322 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]); 316 glVertex3f(this->bvElement->center->x + this->bvElement->axis[2]->x * this->bvElement->halfLength[2], 317 this->bvElement->center->y + this->bvElement->axis[2]->y * this->bvElement->halfLength[2], 318 this->bvElement->center->z + this->bvElement->axis[2]->z * this->bvElement->halfLength[2]); 323 319 324 320 glEnd();
Note: See TracChangeset
for help on using the changeset viewer.