Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5033 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Aug 15, 2005, 9:59:57 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: obb trees are now created for every object in the world. this will use some extra seconds in the startup and will also take some ms in the collision detection algorithm test. took 30fps here… will try to optimize it…

Location:
orxonox/trunk/src
Files:
5 edited

Legend:

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

    r5027 r5033  
    105105void CDEngine::checkCollisionGround()
    106106{
    107   Quadtree* q = this->terrain->ssp->getQuadtree();
     107  if( likely( this->terrain != NULL))
     108  {
     109    Quadtree* q = this->terrain->ssp->getQuadtree();
    108110
    109   QuadtreeNode* n = q->getQuadtreeFromPosition(this->player->getAbsCoor());
    110 
     111    QuadtreeNode* n = q->getQuadtreeFromPosition(this->player->getAbsCoor());
     112  }
    111113  //sTriangleExt* tri = q->getTriangleFromPosition(this->player->getAbsCoor());
    112114}
  • orxonox/trunk/src/subprojects/collision_detection/collision_detection.cc

    r5029 r5033  
    231231
    232232
    233   b->shiftCoor(Vector(0.0, 0.0, iterata * dt * 12.0f));
     233 // b->shiftCoor(Vector(0.0, 0.0, iterata * dt * 12.0f));
    234234
    235235
  • orxonox/trunk/src/world_entities/environment.cc

    r5029 r5033  
    3333{
    3434  this->setClassID(CL_ENVIRONMENT, "Environment");
    35   this->model = (Model*)ResourceManager::getInstance()->load("models/bolido.obj", OBJ, RP_CAMPAIGN);
     35  this->model = (Model*)ResourceManager::getInstance()->load("models/ships/bolido.obj", OBJ, RP_CAMPAIGN);
    3636
    37   this->obbTree = new OBBTree(15, (sVec3D*)this->model->getVertexArray(), this->model->getVertexCount());
     37  if(this->obbTree == NULL)
     38    this->obbTree = new OBBTree(5, (sVec3D*)this->model->getVertexArray(), this->model->getVertexCount());
    3839}
    3940
  • orxonox/trunk/src/world_entities/npc.cc

    r5029 r5033  
    2020
    2121#include "npc.h"
     22#include "obb_tree.h"
    2223
    2324#include "state.h"
     
    3233
    3334  this->loadModel("models/ships/bolido.obj");
     35  if(this->obbTree == NULL)
     36    this->obbTree = new OBBTree(5, (sVec3D*)this->model->getVertexArray(), this->model->getVertexCount());
    3437}
    3538
     
    5356
    5457
     58
  • orxonox/trunk/src/world_entities/world_entity.cc

    r5029 r5033  
    7373    PRINTF(4)("loading %s\n", fileName);
    7474    this->model = (Model*)ResourceManager::getInstance()->load(fileName, OBJ, RP_CAMPAIGN);
     75    PRINTF(4)("creating obb tree\n");
     76    this->obbTree = new OBBTree(5, (sVec3D*)this->model->getVertexArray(), this->model->getVertexCount());
    7577  }
    7678  else
Note: See TracChangeset for help on using the changeset viewer.