- Timestamp:
- Jun 13, 2005, 11:30:58 PM (19 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/collision_detection/obb_tree.cc
r4622 r4626 65 65 this->rootNode = node; 66 66 this->rootNode->setTreeRef(this); 67 this->rootNode->spawnBVTree( depth, verticesList, length);67 this->rootNode->spawnBVTree(--depth, verticesList, length); 68 68 } 69 69 -
orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
r4622 r4626 71 71 void OBBTreeNode::spawnBVTree(const int depth, sVec3D *verticesList, const int length) 72 72 { 73 printf("OBB Depth: %i\n", depth); 73 74 this->depth = depth; 74 75 75 76 this->bvElement = this->createBox(); 77 PRINTF(0)("Created OBBox\n"); 76 78 this->calculateBoxAttributes(this->bvElement, verticesList, length); 79 PRINTF(0)("Calculated attributes\n"); 77 80 78 81 if( likely( this->depth > 0)) 79 82 { 80 83 this->forkBox(this->bvElement); 84 81 85 } 82 86 } … … 126 130 /* take the average of the centroid sum */ 127 131 center /= face; 128 132 PRINTF(0)("-- Calculated Center\n"); 129 133 130 134 … … 145 149 } 146 150 } 147 148 printf("\nVertex Data:\n"); 149 for(int i = 0; i < length; i++) 150 { 151 printf("vertex %i: %f, %f, %f\n", i, verticesList[i][0], verticesList[i][1], verticesList[i][2]); 152 } 151 PRINTF(0)("-- Calculated Covariance\n"); 152 153 // printf("\nVertex Data:\n"); 154 // for(int i = 0; i < length; i++) 155 // { 156 // printf("vertex %i: %f, %f, %f\n", i, verticesList[i][0], verticesList[i][1], verticesList[i][2]); 157 // } 153 158 154 159 printf("\nCovariance Matrix:\n"); … … 173 178 } 174 179 *box->center = center; 175 180 PRINTF(0)("-- Written Result to obb\n"); 176 181 177 182 /* now getting spanning vectors of the sub-space: … … 197 202 198 203 Jacobi(C, D, V); /* do the jacobi decomposition */ 199 200 printf("\nwe got a result! YES: \n"); 201 202 for(int j = 1; j < 4; ++j) 203 { 204 printf(" |"); 205 for(int k = 1; k < 4; ++k) 206 { 207 printf(" \b%f ", V(j, k)); 208 } 209 printf(" |\n"); 210 } 204 PRINTF(0)("-- Done Jacobi Decomposition\n"); 205 206 // printf("\nwe got a result! YES: \n"); 207 // 208 // for(int j = 1; j < 4; ++j) 209 // { 210 // printf(" |"); 211 // for(int k = 1; k < 4; ++k) 212 // { 213 // printf(" \b%f ", V(j, k)); 214 // } 215 // printf(" |\n"); 216 // } 211 217 212 218 axis[0] = new Vector(V(1, 1), V(2, 1), V(3, 1)); … … 214 220 axis[2] = new Vector(V(1, 3), V(2, 3), V(3, 3)); 215 221 box->axis = axis; 216 217 printf("\neigenvector: %f, %f, %f\n", box->axis[0]->x, box->axis[0]->y, box->axis[0]->z); 218 printf("eigenvector: %f, %f, %f\n", box->axis[1]->x, box->axis[1]->y, box->axis[1]->z); 219 printf("eigenvector: %f, %f, %f\n", box->axis[2]->x, box->axis[2]->y, box->axis[2]->z); 222 PRINTF(0)("-- Got Axis\n"); 223 224 // delete &V; 225 // delete &D; 226 // delete &V; 227 228 // printf("\neigenvector: %f, %f, %f\n", box->axis[0]->x, box->axis[0]->y, box->axis[0]->z); 229 // printf("eigenvector: %f, %f, %f\n", box->axis[1]->x, box->axis[1]->y, box->axis[1]->z); 230 // printf("eigenvector: %f, %f, %f\n", box->axis[2]->x, box->axis[2]->y, box->axis[2]->z); 220 231 221 232 … … 253 264 254 265 box->halfLength = halfLength; 255 256 257 printf("\nwe got length: \n"); 258 for(int i = 0; i < 3; ++i) 259 printf("length[%i] = %f\n", i, box->halfLength[i]); 266 PRINTF(0)("-- Written Axis to obb\n"); 267 268 269 // printf("\nwe got length: \n"); 270 // for(int i = 0; i < 3; ++i) 271 // printf("length[%i] = %f\n", i, box->halfLength[i]); 260 272 } 261 273 … … 346 358 } 347 359 348 printf("\npartition 1:\n");349 for(int i = 0; i < partition1.getSize(); ++i)350 {351 printf("v[%i][0] = %f\n", i, vertList1[i][0]);352 printf("v[%i][1] = %f\n", i, vertList1[i][1]);353 printf("v[%i][2] = %f\n", i, vertList1[i][2]);354 }360 // printf("\npartition 1:\n"); 361 // for(int i = 0; i < partition1.getSize(); ++i) 362 // { 363 // printf("v[%i][0] = %f\n", i, vertList1[i][0]); 364 // printf("v[%i][1] = %f\n", i, vertList1[i][1]); 365 // printf("v[%i][2] = %f\n", i, vertList1[i][2]); 366 // } 355 367 356 368 iterator = partition2.getIterator(); … … 366 378 } 367 379 368 printf("\npartition 2:\n"); 369 for(int i = 0; i < partition2.getSize(); ++i) 370 { 371 printf("v[%i][0] = %f\n", i, vertList2[i][0]); 372 printf("v[%i][1] = %f\n", i, vertList2[i][1]); 373 printf("v[%i][2] = %f\n", i, vertList2[i][2]); 374 } 380 //delete iterator; 381 // printf("\npartition 2:\n"); 382 // for(int i = 0; i < partition2.getSize(); ++i) 383 // { 384 // printf("v[%i][0] = %f\n", i, vertList2[i][0]); 385 // printf("v[%i][1] = %f\n", i, vertList2[i][1]); 386 // printf("v[%i][2] = %f\n", i, vertList2[i][2]); 387 // } 375 388 376 389 /* now spawn the obb tree: create the nodes and descent */ … … 386 399 387 400 401 402 388 403 void OBBTreeNode::collideWith(const BVTree &tree) 389 404 {} 405 406 390 407 391 408 -
orxonox/trunk/src/subprojects/collision_detection/Makefile.am
r4616 r4626 13 13 $(GTK2_LIBS) $(GTHREAD_LIBS) $(CURL_LIBS) \ 14 14 -lpthread 15 16 15 17 16 18 collision_CPPFLAGS = -DGUI_MODULE \ … … 39 41 $(MAINSRCDIR)/lib/coord/p_node.cc \ 40 42 $(MAINSRCDIR)/lib/coord/null_parent.cc \ 41 $(MAINSRCDIR)/lib/gui/gui_gtk.cc \42 43 $(MAINSRCDIR)/lib/newmat/include.h \ 43 44 $(MAINSRCDIR)/lib/newmat/newmat.h \ 44 45 $(MAINSRCDIR)/lib/newmat/newmatap.h \ 45 $(MAINSRCDIR)/lib/newmatio.h 46 $(MAINSRCDIR)/lib/newmatio.h \ 47 $(MAINSRCDIR)/lib/gui/gui_gtk.cc -
orxonox/trunk/src/subprojects/collision_detection/Makefile.in
r4616 r4626 256 256 $(MAINSRCDIR)/lib/coord/p_node.cc \ 257 257 $(MAINSRCDIR)/lib/coord/null_parent.cc \ 258 $(MAINSRCDIR)/lib/gui/gui_gtk.cc \259 258 $(MAINSRCDIR)/lib/newmat/include.h \ 260 259 $(MAINSRCDIR)/lib/newmat/newmat.h \ 261 260 $(MAINSRCDIR)/lib/newmat/newmatap.h \ 262 $(MAINSRCDIR)/lib/newmatio.h 261 $(MAINSRCDIR)/lib/newmatio.h \ 262 $(MAINSRCDIR)/lib/gui/gui_gtk.cc 263 263 264 264 all: all-am -
orxonox/trunk/src/subprojects/collision_detection/collision_detection.cc
r4622 r4626 35 35 model = new MD2Model("models/tris.md2", "models/tris.pcx"); 36 36 model->tick(0.1f); 37 CDEngine::getInstance()->debugSpawnTree(1, model->data->pVertices, model->data->numVertices); 37 CDEngine::getInstance()->debugSpawnTree(10, model->data->pVertices, model->data->numVertices); 38 38 39 39 40 LightManager* lightMan = LightManager::getInstance(); … … 87 88 void Framework::moduleInitGui(int argc, char** argv) 88 89 { 89 //Window* guiMainWindow = NULL;90 // 91 //initGUI(0, NULL);92 // 93 //guiMainWindow = new Window("Collision_detection");94 //{95 // //all the Widgets you need96 //}97 //Window::mainWindow->showall();98 //Window::mainWindow->setSize(300, 500);90 Window* guiMainWindow = NULL; 91 92 initGUI(0, NULL); 93 94 guiMainWindow = new Window("Collision_detection"); 95 { 96 //all the Widgets you need 97 } 98 Window::mainWindow->showall(); 99 Window::mainWindow->setSize(300, 500); 99 100 }
Note: See TracChangeset
for help on using the changeset viewer.