Changeset 4712 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Jun 26, 2005, 10:56:45 PM (19 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/collision_detection/bv_tree.h
r4700 r4712 26 26 DRAW_BV_BLENDED = 1<<4, 27 27 DRAW_BV_POLYGON = 1<<5, 28 DRAW_MODEL = 1<<6 28 DRAW_MODEL = 1<<6, 29 DRAW_POINTS = 1<<7 29 30 }; 30 31 -
orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
r4711 r4712 472 472 PRINTF(3)("-- Finished Calculating Attributes\n"); 473 473 474 475 476 // PRINTF(3)("\nwe got length: \n");477 for(int i = 0; i < 3; ++i)478 {479 //if( box->halfLength[i] == 0.0)480 if(fabs(box->halfLength[i]) > 5.0f)481 {482 PRINTF(0)("length[%i] = %f\n", i, box->halfLength[i]);483 PRINTF(0)("MaxLength = %f, MinLength = %f\n", maxLength[i], minLength[i]);484 PRINTF(0)("\nVertex Data:\n");485 for(int i = 0; i < length; i++)486 {487 PRINTF(0)("vertex %i: %f, %f, %f\n", i, box->vertices[i][0], box->vertices[i][1], box->vertices[i][2]);488 }489 }490 }491 474 } 492 475 … … 626 609 /* if the obb overlap, make subtests: check which node is realy overlaping */ 627 610 PRINT(3)("Checking OBB %i vs %i: ", this->getIndex(), treeNode->getIndex()); 611 //if( unlikely()) 628 612 if( this->overlapTest(this->bvElement, ((OBBTreeNode*)treeNode)->bvElement, nodeA, nodeB)) 629 613 { … … 780 764 if( !(drawMode & DRAW_SINGLE && depth != 0)) 781 765 { 766 if( drawMode & DRAW_POINTS) 767 glBegin(GL_POINTS); 782 768 for(int i = 0; i < this->bvElement->numOfVertices; ++i) 783 769 { 784 glPushMatrix(); 785 //glMatrixMode(GL_MODELVIEW); 786 //glVertex3f(this->bvElement->vertices[i][0], this->bvElement->vertices[i][1], this->bvElement->vertices[i][2]); 787 glTranslatef(this->bvElement->vertices[i][0], this->bvElement->vertices[i][1], this->bvElement->vertices[i][2]); 788 gluSphere(this->sphereObj, 0.1, 10, 10); 789 //PRINTF(0)("v(%f, %f, %f)\n", this->bvElement->vertices[i][0], this->bvElement->vertices[i][1], this->bvElement->vertices[i][2]); 790 glPopMatrix(); 770 if( drawMode & DRAW_POINTS) 771 glVertex3f(this->bvElement->vertices[i][0], this->bvElement->vertices[i][1], this->bvElement->vertices[i][2]); 772 else 773 { 774 glPushMatrix(); 775 glTranslatef(this->bvElement->vertices[i][0], this->bvElement->vertices[i][1], this->bvElement->vertices[i][2]); 776 gluSphere(this->sphereObj, 0.1, 10, 10); 777 glPopMatrix(); 778 } 791 779 } 780 if( drawMode & DRAW_POINTS) 781 glEnd(); 792 782 } 793 783 } -
orxonox/trunk/src/subprojects/collision_detection/collision_detection.cc
r4711 r4712 79 79 entityList = new tList<WorldEntity>(); 80 80 81 a = new TestEntity(); a->setName("Clown1"); 82 b = new Environment(); a->setName("Clown"); 83 //b = new Environment(); b->setName("Jaeger"); 81 a = new TestEntity(); a->setName("Clown1"); 82 b = new Environment(); b->setName("Jaeger"); 84 83 //c = new Terrain(); 85 84 86 85 b->setRelCoor(0.0, 0.0, -10.0); 87 86 //b->setRelDir(Quaternion(-M_PI/2.0f, Vector(0.0, 1.0, 0.0))); 88 87 … … 336 335 337 336 337 int drawPoints(GtkWidget* nonInterest, void* widget) 338 { 339 if(drawMode & DRAW_POINTS) 340 { 341 int temp = drawMode & DRAW_POINTS; 342 drawMode ^= temp; 343 344 } 345 else 346 { 347 drawMode |= DRAW_POINTS; 348 printf("Drawing OBB Polygons\n"); 349 } 350 } 351 352 338 353 int treeDepth(GtkWidget* nonInterest, void* widget) 339 354 { … … 377 392 378 393 394 CheckButton* DrawPoints = new CheckButton("Draw Points"); 395 DrawPoints->connectSignal("clicked", (void*)DrawPoints, drawPoints); 396 windowBox->fill(DrawPoints); 397 398 379 399 CheckButton* SeperatingPlanes = new CheckButton("SeperatingPlanes"); 380 400 SeperatingPlanes->connectSignal("clicked", (void*)SeperatingPlanes, seperatingPlanes); … … 382 402 383 403 384 Slider* TreeDepth = new Slider("TreeDepth", 0, 1 0);404 Slider* TreeDepth = new Slider("TreeDepth", 0, 17); 385 405 TreeDepth->connectSignal("value_changed", (void*)TreeDepth, treeDepth); 386 406 windowBox->fill(TreeDepth); -
orxonox/trunk/src/world_entities/environment.cc
r4710 r4712 35 35 this->model = (Model*)ResourceManager::getInstance()->load("models/reaplow.obj"/*"worlds/vulcania.obj"*/, OBJ, RP_CAMPAIGN); 36 36 37 this->obbTree = new OBBTree(1 0, (sVec3D*)this->model->getVertexArray(), this->model->getVertexCount());37 this->obbTree = new OBBTree(15, (sVec3D*)this->model->getVertexArray(), this->model->getVertexCount()); 38 38 } 39 39 -
orxonox/trunk/src/world_entities/test_entity.cc
r4682 r4712 32 32 33 33 this->md2Model = new MD2Model("models/tris.md2", "models/tris.pcx"); 34 this->obbTree = new OBBTree( 4, (sVec3D*)this->md2Model->data->pVertices, this->md2Model->data->numVertices);34 this->obbTree = new OBBTree(7, (sVec3D*)this->md2Model->data->pVertices, this->md2Model->data->numVertices); 35 35 this->md2Model->debug(); 36 36 }
Note: See TracChangeset
for help on using the changeset viewer.