Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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…

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.