Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4675 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Jun 23, 2005, 11:08:06 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: now used the player model to do an obb on it - works greatly and it realy makes sense! im so excited…

Location:
orxonox/trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/collision_detection/cd_engine.cc

    r4635 r4675  
    5252
    5353
     54void CDEngine::checkCollisions()
     55{
     56
     57}
     58
     59
    5460
    5561void CDEngine::drawBV(int depth, int drawMode) const
  • orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc

    r4674 r4675  
    300300  for(int i = 0; i < length; i++)
    301301  {
    302     //PRINTF(0)("vertex %i: %f, %f, %f\n", i, verticesList[i][0], verticesList[i][1], verticesList[i][2]);
    303302    PRINTF(3)("vertex %i: %f, %f, %f\n", i, box->vertices[i][0], box->vertices[i][1], box->vertices[i][2]);
    304303  }
    305304
    306305
    307   PRINTF(0)("\nCovariance Matrix:\n");
     306  PRINTF(3)("\nCovariance Matrix:\n");
    308307  for(int j = 0; j < 3; ++j)
    309308  {
    310     PRINT(0)(" |");
     309    PRINT(3)(" |");
    311310    for(int k = 0; k < 3; ++k)
    312311    {
    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");
    316315  }
    317316
     
    369368  PRINTF(3)("-- Got Axis\n");
    370369
    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);
    374373}
    375374
     
    627626        //glVertex3f(this->bvElement->vertices[i][0], this->bvElement->vertices[i][1], this->bvElement->vertices[i][2]);
    628627        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);
    630629        //PRINTF(0)("v(%f, %f, %f)\n", this->bvElement->vertices[i][0], this->bvElement->vertices[i][1], this->bvElement->vertices[i][2]);
    631630        glPopMatrix();
  • orxonox/trunk/src/subprojects/collision_detection/Makefile.am

    r4646 r4675  
    3333                   $(MAINSRCDIR)/lib/coord/p_node.cc \
    3434                   $(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  
    6060        collision-resource_manager.$(OBJEXT) \
    6161        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)
    6364collision_OBJECTS = $(am_collision_OBJECTS)
    6465am__DEPENDENCIES_1 =
     
    8788@AMDEP_TRUE@    ./$(DEPDIR)/collision-state.Po \
    8889@AMDEP_TRUE@    ./$(DEPDIR)/collision-substring.Po \
     90@AMDEP_TRUE@    ./$(DEPDIR)/collision-test_entity.Po \
    8991@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
    9194CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
    9295        $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
     
    9497CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
    9598        -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 $@
    10099SOURCES = $(collision_SOURCES)
    101100DIST_SOURCES = $(collision_SOURCES)
     
    238237                   $(MAINSRCDIR)/lib/coord/p_node.cc \
    239238                   $(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
    245242
    246243all: all-am
     
    324321@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/collision-state.Po@am__quote@
    325322@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@
    326324@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/collision-text_engine.Po@am__quote@
    327325@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@
    328327
    329328.cc.o:
     
    598597@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    599598@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
     600collision-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
     608collision-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
     616collision-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
     624collision-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`
    600631uninstall-info-am:
    601632
  • orxonox/trunk/src/subprojects/collision_detection/collision_detection.cc

    r4673 r4675  
    2626
    2727#include "md2Model.h"
     28#include "model.h"
     29#include "test_entity.h"
    2830
    2931#include "graphics_engine.h"
    30 
    31 
    32 
     32#include "list.h"
     33
     34
     35Model* mod;
    3336MD2Model* model;
    3437int drawMode;
    3538int depth;
     39tList<WorldEntity>* entityList;
    3640
    3741void Framework::moduleInit(int argc, char** argv)
     
    4246  //CDEngine::getInstance()->debug();
    4347
    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 */
    5163  LightManager* lightMan = LightManager::getInstance();
    5264  lightMan->setAmbientColor(.1,.1,.1);
     
    5668  lightMan->setPosition(-30, -30, -30);
    5769
     70  /* properties */
    5871  drawMode = DRAW_MODEL;
    5972  depth = 0;
     
    171184void Framework::moduleTick(float dt)
    172185{
     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
    173195}
    174196
     
    180202  LightManager::getInstance()->draw();
    181203
     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;
    182212  //model->draw();
    183213}
Note: See TracChangeset for help on using the changeset viewer.