Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4138 in orxonox.OLD for orxonox/branches


Ignore:
Timestamp:
May 10, 2005, 10:15:57 AM (20 years ago)
Author:
patrick
Message:

orxonox/branches/md2_loader: modified the MD2Model class so it is able to draw the model, very bad style, just debugging the code. Some worse hacks in world class

Location:
orxonox/branches/md2_loader/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/md2_loader/src/Makefile.in

    r4078 r4138  
    7373        track_manager.$(OBJEXT) track_node.$(OBJEXT) factory.$(OBJEXT) \
    7474        animation.$(OBJEXT) animation3d.$(OBJEXT) \
    75         animation_player.$(OBJEXT) garbage_collector.$(OBJEXT) \
    76         story_entity.$(OBJEXT) campaign.$(OBJEXT) world.$(OBJEXT) \
    77         world_entity.$(OBJEXT) player.$(OBJEXT) environment.$(OBJEXT) \
    78         skysphere.$(OBJEXT) skybox.$(OBJEXT) terrain.$(OBJEXT) \
    79         weapon.$(OBJEXT) projectile.$(OBJEXT) satellite.$(OBJEXT) \
     75        animation_player.$(OBJEXT) object_manager.$(OBJEXT) \
     76        garbage_collector.$(OBJEXT) story_entity.$(OBJEXT) \
     77        campaign.$(OBJEXT) world.$(OBJEXT) world_entity.$(OBJEXT) \
     78        player.$(OBJEXT) environment.$(OBJEXT) skysphere.$(OBJEXT) \
     79        skybox.$(OBJEXT) terrain.$(OBJEXT) weapon.$(OBJEXT) \
     80        projectile.$(OBJEXT) satellite.$(OBJEXT) \
    8081        character_attributes.$(OBJEXT) test_gun.$(OBJEXT) \
    8182        test_bullet.$(OBJEXT) ai.$(OBJEXT) p_node.$(OBJEXT) \
     
    124125@AMDEP_TRUE@    ./$(DEPDIR)/material.Po ./$(DEPDIR)/md2Model.Po \
    125126@AMDEP_TRUE@    ./$(DEPDIR)/model.Po ./$(DEPDIR)/null_parent.Po \
    126 @AMDEP_TRUE@    ./$(DEPDIR)/objModel.Po ./$(DEPDIR)/orxonox.Po \
    127 @AMDEP_TRUE@    ./$(DEPDIR)/p_node.Po \
     127@AMDEP_TRUE@    ./$(DEPDIR)/objModel.Po \
     128@AMDEP_TRUE@    ./$(DEPDIR)/object_manager.Po \
     129@AMDEP_TRUE@    ./$(DEPDIR)/orxonox.Po ./$(DEPDIR)/p_node.Po \
    128130@AMDEP_TRUE@    ./$(DEPDIR)/particle_emitter.Po \
    129131@AMDEP_TRUE@    ./$(DEPDIR)/particle_engine.Po \
     
    286288                 util/animation/animation3d.cc \
    287289                 util/animation/animation_player.cc \
     290                 util/object_manager.cc \
    288291                 garbage_collector.cc \
    289292                 story_entities/story_entity.cc \
     
    347350                 util/animation/animation3d.h \
    348351                 util/animation/animation_player.h \
     352                 util/object_manager.h \
    349353                 garbage_collector.h \
    350354                 story_entities/story_entity.h \
     
    550554@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/null_parent.Po@am__quote@
    551555@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/objModel.Po@am__quote@
     556@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/object_manager.Po@am__quote@
    552557@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox.Po@am__quote@
    553558@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p_node.Po@am__quote@
     
    818823@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    819824@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o animation_player.obj `if test -f 'util/animation/animation_player.cc'; then $(CYGPATH_W) 'util/animation/animation_player.cc'; else $(CYGPATH_W) '$(srcdir)/util/animation/animation_player.cc'; fi`
     825
     826object_manager.o: util/object_manager.cc
     827@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT object_manager.o -MD -MP -MF "$(DEPDIR)/object_manager.Tpo" -c -o object_manager.o `test -f 'util/object_manager.cc' || echo '$(srcdir)/'`util/object_manager.cc; \
     828@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/object_manager.Tpo" "$(DEPDIR)/object_manager.Po"; else rm -f "$(DEPDIR)/object_manager.Tpo"; exit 1; fi
     829@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='util/object_manager.cc' object='object_manager.o' libtool=no @AMDEPBACKSLASH@
     830@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/object_manager.Po' tmpdepfile='$(DEPDIR)/object_manager.TPo' @AMDEPBACKSLASH@
     831@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     832@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o object_manager.o `test -f 'util/object_manager.cc' || echo '$(srcdir)/'`util/object_manager.cc
     833
     834object_manager.obj: util/object_manager.cc
     835@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT object_manager.obj -MD -MP -MF "$(DEPDIR)/object_manager.Tpo" -c -o object_manager.obj `if test -f 'util/object_manager.cc'; then $(CYGPATH_W) 'util/object_manager.cc'; else $(CYGPATH_W) '$(srcdir)/util/object_manager.cc'; fi`; \
     836@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/object_manager.Tpo" "$(DEPDIR)/object_manager.Po"; else rm -f "$(DEPDIR)/object_manager.Tpo"; exit 1; fi
     837@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='util/object_manager.cc' object='object_manager.obj' libtool=no @AMDEPBACKSLASH@
     838@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/object_manager.Po' tmpdepfile='$(DEPDIR)/object_manager.TPo' @AMDEPBACKSLASH@
     839@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     840@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o object_manager.obj `if test -f 'util/object_manager.cc'; then $(CYGPATH_W) 'util/object_manager.cc'; else $(CYGPATH_W) '$(srcdir)/util/object_manager.cc'; fi`
    820841
    821842story_entity.o: story_entities/story_entity.cc
  • orxonox/branches/md2_loader/src/lib/graphics/importer/md2Model.cc

    r4126 r4138  
    4949}
    5050
     51/**
     52  \brief draw function
     53 
     54  these function will take NO argument in the final version, just for testing
     55*/
     56void MD2Model::draw(t3DModel *pModel)
     57{
     58        if( pModel->objectList->getSize() <= 0) return;
     59
     60        t3DObject *pObject = pModel->objectList->firstElement();
     61        glBegin(GL_TRIANGLES);
     62                for(int j = 0; j < pObject->numOfFaces; j++)
     63                {
     64                        for(int whichVertex = 0; whichVertex < 3; whichVertex++)
     65                        {
     66                                int index = pObject->pFaces[j].vertIndex[whichVertex];
     67                                int index2 = pObject->pFaces[j].coordIndex[whichVertex];
     68                                /* we invert the normals since the md2 file format uses different style */
     69                                glNormal3f(-pObject->pNormals[ index ].x, -pObject->pNormals[ index ].y, -pObject->pNormals[ index ].z);
     70                                if(pObject->pTexVerts)
     71                                {
     72                                        glTexCoord2f(pObject->pTexVerts[ index2 ].x, pObject->pTexVerts[ index2 ].y);
     73                                }
     74                                glVertex3f(pObject->pVerts[ index ].x, pObject->pVerts[ index ].y, pObject->pVerts[ index ].z);
     75                        }
     76                }
     77        glEnd();
     78}
    5179
    5280/********************************************************************************
  • orxonox/branches/md2_loader/src/lib/graphics/importer/md2Model.h

    r4079 r4138  
    118118  void drawFrame(int frame);
    119119 
     120  void draw(t3DModel *pModel);
     121 
    120122  void setAnim(int type);
    121123  void scaleModel(float s);
  • orxonox/branches/md2_loader/src/story_entities/world.cc

    r4072 r4138  
    5050
    5151#include "substring.h"
     52
     53#include "md2Model.h"
    5254
    5355using namespace std;
     
    473475  terrain->setRelCoor(Vector(0,-10,0));
    474476  this->spawn(terrain);
     477 
     478 
     479
     480  //This is for md2 test purposes only! if this is seen in the trunk: hit me :)
     481  MD2Loader* md2loader = new MD2Loader();
     482  this->model = new t3DModel;
     483  this->md2Model = new MD2Model();
     484 
     485  md2loader->importMD2(model, "test.md2", "test.bmp");
    475486
    476487}
     
    931942    }
    932943  delete iterator;
     944
     945  /* TESTGING TESTING TESTING */
     946  this->md2Model->draw(this->model);
    933947 
    934948  glCallList (objectList);
  • orxonox/branches/md2_loader/src/story_entities/world.h

    r4015 r4138  
    2323class GarbageCollector;
    2424class Text;
     25
     26/* TESTING TESTING TESTING */
     27struct t3DModel;
     28class MD2Model;
    2529
    2630//! The game world Interface
     
    118122  GarbageCollector* garbageCollector; //!< reference to the garbage  collector
    119123
     124  /* TESTING TESTING TESTING */
     125  t3DModel* model;
     126  MD2Model* md2Model;
     127
     128
    120129  /* function for main-loop */
    121130  void mainLoop ();
Note: See TracChangeset for help on using the changeset viewer.