- Timestamp:
- Jun 23, 2005, 11:08:06 PM (19 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/collision_detection/cd_engine.cc
r4635 r4675 52 52 53 53 54 void CDEngine::checkCollisions() 55 { 56 57 } 58 59 54 60 55 61 void CDEngine::drawBV(int depth, int drawMode) const -
orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc
r4674 r4675 300 300 for(int i = 0; i < length; i++) 301 301 { 302 //PRINTF(0)("vertex %i: %f, %f, %f\n", i, verticesList[i][0], verticesList[i][1], verticesList[i][2]);303 302 PRINTF(3)("vertex %i: %f, %f, %f\n", i, box->vertices[i][0], box->vertices[i][1], box->vertices[i][2]); 304 303 } 305 304 306 305 307 PRINTF( 0)("\nCovariance Matrix:\n");306 PRINTF(3)("\nCovariance Matrix:\n"); 308 307 for(int j = 0; j < 3; ++j) 309 308 { 310 PRINT( 0)(" |");309 PRINT(3)(" |"); 311 310 for(int k = 0; k < 3; ++k) 312 311 { 313 PRINT( 0)(" \b%f ", covariance[j][k]);314 } 315 PRINT( 0)(" |\n");312 PRINT(3)(" \b%f ", covariance[j][k]); 313 } 314 PRINT(3)(" |\n"); 316 315 } 317 316 … … 369 368 PRINTF(3)("-- Got Axis\n"); 370 369 371 PRINTF( 0)("eigenvector: %f, %f, %f\n", box->axis[0].x, box->axis[0].y, box->axis[0].z);372 PRINTF( 0)("eigenvector: %f, %f, %f\n", box->axis[1].x, box->axis[1].y, box->axis[1].z);373 PRINTF( 0)("eigenvector: %f, %f, %f\n", box->axis[2].x, box->axis[2].y, box->axis[2].z);370 PRINTF(3)("eigenvector: %f, %f, %f\n", box->axis[0].x, box->axis[0].y, box->axis[0].z); 371 PRINTF(3)("eigenvector: %f, %f, %f\n", box->axis[1].x, box->axis[1].y, box->axis[1].z); 372 PRINTF(3)("eigenvector: %f, %f, %f\n", box->axis[2].x, box->axis[2].y, box->axis[2].z); 374 373 } 375 374 … … 627 626 //glVertex3f(this->bvElement->vertices[i][0], this->bvElement->vertices[i][1], this->bvElement->vertices[i][2]); 628 627 glTranslatef(this->bvElement->vertices[i][0], this->bvElement->vertices[i][1], this->bvElement->vertices[i][2]); 629 gluSphere(this->sphereObj, 1, 10, 10);628 gluSphere(this->sphereObj, 0.2, 10, 10); 630 629 //PRINTF(0)("v(%f, %f, %f)\n", this->bvElement->vertices[i][0], this->bvElement->vertices[i][1], this->bvElement->vertices[i][2]); 631 630 glPopMatrix(); -
orxonox/trunk/src/subprojects/collision_detection/Makefile.am
r4646 r4675 33 33 $(MAINSRCDIR)/lib/coord/p_node.cc \ 34 34 $(MAINSRCDIR)/lib/coord/null_parent.cc \ 35 $(MAINSRCDIR)/lib/newmat/include.h \ 36 $(MAINSRCDIR)/lib/newmat/newmat.h \ 37 $(MAINSRCDIR)/lib/newmat/newmatap.h \ 38 $(MAINSRCDIR)/lib/newmatio.h \ 39 $(MAINSRCDIR)/lib/gui/gui_gtk.cc 35 $(MAINSRCDIR)/lib/gui/gui_gtk.cc \ 36 $(MAINSRCDIR)/world_entities/test_entity.cc \ 37 $(MAINSRCDIR)/world_entities/world_entity.cc 38 -
orxonox/trunk/src/subprojects/collision_detection/Makefile.in
r4646 r4675 60 60 collision-resource_manager.$(OBJEXT) \ 61 61 collision-p_node.$(OBJEXT) collision-null_parent.$(OBJEXT) \ 62 collision-gui_gtk.$(OBJEXT) 62 collision-gui_gtk.$(OBJEXT) collision-test_entity.$(OBJEXT) \ 63 collision-world_entity.$(OBJEXT) 63 64 collision_OBJECTS = $(am_collision_OBJECTS) 64 65 am__DEPENDENCIES_1 = … … 87 88 @AMDEP_TRUE@ ./$(DEPDIR)/collision-state.Po \ 88 89 @AMDEP_TRUE@ ./$(DEPDIR)/collision-substring.Po \ 90 @AMDEP_TRUE@ ./$(DEPDIR)/collision-test_entity.Po \ 89 91 @AMDEP_TRUE@ ./$(DEPDIR)/collision-text_engine.Po \ 90 @AMDEP_TRUE@ ./$(DEPDIR)/collision-vector.Po 92 @AMDEP_TRUE@ ./$(DEPDIR)/collision-vector.Po \ 93 @AMDEP_TRUE@ ./$(DEPDIR)/collision-world_entity.Po 91 94 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ 92 95 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) … … 94 97 CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ 95 98 -o $@ 96 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \97 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)98 CCLD = $(CC)99 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@100 99 SOURCES = $(collision_SOURCES) 101 100 DIST_SOURCES = $(collision_SOURCES) … … 238 237 $(MAINSRCDIR)/lib/coord/p_node.cc \ 239 238 $(MAINSRCDIR)/lib/coord/null_parent.cc \ 240 $(MAINSRCDIR)/lib/newmat/include.h \ 241 $(MAINSRCDIR)/lib/newmat/newmat.h \ 242 $(MAINSRCDIR)/lib/newmat/newmatap.h \ 243 $(MAINSRCDIR)/lib/newmatio.h \ 244 $(MAINSRCDIR)/lib/gui/gui_gtk.cc 239 $(MAINSRCDIR)/lib/gui/gui_gtk.cc \ 240 $(MAINSRCDIR)/world_entities/test_entity.cc \ 241 $(MAINSRCDIR)/world_entities/world_entity.cc 245 242 246 243 all: all-am … … 324 321 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/collision-state.Po@am__quote@ 325 322 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/collision-substring.Po@am__quote@ 323 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/collision-test_entity.Po@am__quote@ 326 324 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/collision-text_engine.Po@am__quote@ 327 325 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/collision-vector.Po@am__quote@ 326 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/collision-world_entity.Po@am__quote@ 328 327 329 328 .cc.o: … … 598 597 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 599 598 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(collision_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o collision-gui_gtk.obj `if test -f '$(MAINSRCDIR)/lib/gui/gui_gtk.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/gui/gui_gtk.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/gui/gui_gtk.cc'; fi` 599 600 collision-test_entity.o: $(MAINSRCDIR)/world_entities/test_entity.cc 601 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(collision_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT collision-test_entity.o -MD -MP -MF "$(DEPDIR)/collision-test_entity.Tpo" -c -o collision-test_entity.o `test -f '$(MAINSRCDIR)/world_entities/test_entity.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/world_entities/test_entity.cc; \ 602 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/collision-test_entity.Tpo" "$(DEPDIR)/collision-test_entity.Po"; else rm -f "$(DEPDIR)/collision-test_entity.Tpo"; exit 1; fi 603 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/world_entities/test_entity.cc' object='collision-test_entity.o' libtool=no @AMDEPBACKSLASH@ 604 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/collision-test_entity.Po' tmpdepfile='$(DEPDIR)/collision-test_entity.TPo' @AMDEPBACKSLASH@ 605 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 606 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(collision_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o collision-test_entity.o `test -f '$(MAINSRCDIR)/world_entities/test_entity.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/world_entities/test_entity.cc 607 608 collision-test_entity.obj: $(MAINSRCDIR)/world_entities/test_entity.cc 609 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(collision_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT collision-test_entity.obj -MD -MP -MF "$(DEPDIR)/collision-test_entity.Tpo" -c -o collision-test_entity.obj `if test -f '$(MAINSRCDIR)/world_entities/test_entity.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/world_entities/test_entity.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/world_entities/test_entity.cc'; fi`; \ 610 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/collision-test_entity.Tpo" "$(DEPDIR)/collision-test_entity.Po"; else rm -f "$(DEPDIR)/collision-test_entity.Tpo"; exit 1; fi 611 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/world_entities/test_entity.cc' object='collision-test_entity.obj' libtool=no @AMDEPBACKSLASH@ 612 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/collision-test_entity.Po' tmpdepfile='$(DEPDIR)/collision-test_entity.TPo' @AMDEPBACKSLASH@ 613 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 614 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(collision_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o collision-test_entity.obj `if test -f '$(MAINSRCDIR)/world_entities/test_entity.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/world_entities/test_entity.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/world_entities/test_entity.cc'; fi` 615 616 collision-world_entity.o: $(MAINSRCDIR)/world_entities/world_entity.cc 617 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(collision_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT collision-world_entity.o -MD -MP -MF "$(DEPDIR)/collision-world_entity.Tpo" -c -o collision-world_entity.o `test -f '$(MAINSRCDIR)/world_entities/world_entity.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/world_entities/world_entity.cc; \ 618 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/collision-world_entity.Tpo" "$(DEPDIR)/collision-world_entity.Po"; else rm -f "$(DEPDIR)/collision-world_entity.Tpo"; exit 1; fi 619 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/world_entities/world_entity.cc' object='collision-world_entity.o' libtool=no @AMDEPBACKSLASH@ 620 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/collision-world_entity.Po' tmpdepfile='$(DEPDIR)/collision-world_entity.TPo' @AMDEPBACKSLASH@ 621 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 622 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(collision_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o collision-world_entity.o `test -f '$(MAINSRCDIR)/world_entities/world_entity.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/world_entities/world_entity.cc 623 624 collision-world_entity.obj: $(MAINSRCDIR)/world_entities/world_entity.cc 625 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(collision_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT collision-world_entity.obj -MD -MP -MF "$(DEPDIR)/collision-world_entity.Tpo" -c -o collision-world_entity.obj `if test -f '$(MAINSRCDIR)/world_entities/world_entity.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/world_entities/world_entity.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/world_entities/world_entity.cc'; fi`; \ 626 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/collision-world_entity.Tpo" "$(DEPDIR)/collision-world_entity.Po"; else rm -f "$(DEPDIR)/collision-world_entity.Tpo"; exit 1; fi 627 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/world_entities/world_entity.cc' object='collision-world_entity.obj' libtool=no @AMDEPBACKSLASH@ 628 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/collision-world_entity.Po' tmpdepfile='$(DEPDIR)/collision-world_entity.TPo' @AMDEPBACKSLASH@ 629 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 630 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(collision_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o collision-world_entity.obj `if test -f '$(MAINSRCDIR)/world_entities/world_entity.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/world_entities/world_entity.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/world_entities/world_entity.cc'; fi` 600 631 uninstall-info-am: 601 632 -
orxonox/trunk/src/subprojects/collision_detection/collision_detection.cc
r4673 r4675 26 26 27 27 #include "md2Model.h" 28 #include "model.h" 29 #include "test_entity.h" 28 30 29 31 #include "graphics_engine.h" 30 31 32 32 #include "list.h" 33 34 35 Model* mod; 33 36 MD2Model* model; 34 37 int drawMode; 35 38 int depth; 39 tList<WorldEntity>* entityList; 36 40 37 41 void Framework::moduleInit(int argc, char** argv) … … 42 46 //CDEngine::getInstance()->debug(); 43 47 44 model = new MD2Model("models/tris.md2", "models/tris.pcx"); 45 model->tick(0.1f); 46 47 48 CDEngine::getInstance()->debugSpawnTree(9, model->data->pVertices, model->data->numVertices); 49 50 48 // model = new MD2Model("models/tris.md2", "models/tris.pcx"); 49 // model->tick(0.1f); 50 // CDEngine::getInstance()->debugSpawnTree(9, model->data->pVertices, model->data->numVertices); 51 52 entityList = new tList<WorldEntity>(); 53 54 TestEntity* a = new TestEntity(); 55 56 entityList->add(a); 57 58 59 mod = (Model*)ResourceManager::getInstance()->load("models/reaplow.obj", OBJ, RP_CAMPAIGN); 60 CDEngine::getInstance()->debugSpawnTree(9, (sVec3D*)mod->getVertexArray(), mod->getVertexArrayCount()); 61 62 /* ligths */ 51 63 LightManager* lightMan = LightManager::getInstance(); 52 64 lightMan->setAmbientColor(.1,.1,.1); … … 56 68 lightMan->setPosition(-30, -30, -30); 57 69 70 /* properties */ 58 71 drawMode = DRAW_MODEL; 59 72 depth = 0; … … 171 184 void Framework::moduleTick(float dt) 172 185 { 186 tIterator<WorldEntity>* iterator = entityList->getIterator(); /* get the iterator - JAVA style */ 187 WorldEntity* entity = iterator->nextElement(); /* this returns the FIRST element */ 188 while( entity != NULL) /* nextElement() will return NULL at the end */ 189 { 190 entity->tick(0.2); 191 entity = iterator->nextElement(); /* give back the next element or NULL if last */ 192 } 193 delete iterator; 194 173 195 } 174 196 … … 180 202 LightManager::getInstance()->draw(); 181 203 204 // tIterator<WorldEntity>* iterator = entityList->getIterator(); /* get the iterator - JAVA style */ 205 // WorldEntity* entity = iterator->nextElement(); /* this returns the FIRST element */ 206 // while( entity != NULL) /* nextElement() will return NULL at the end */ 207 // { 208 // entity->draw(); 209 // entity = iterator->nextElement(); /* give back the next element or NULL if last */ 210 // } 211 // delete iterator; 182 212 //model->draw(); 183 213 }
Note: See TracChangeset
for help on using the changeset viewer.