Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7537 in orxonox.OLD


Ignore:
Timestamp:
May 4, 2006, 4:35:25 PM (18 years ago)
Author:
patrick
Message:

collision: setup test topology

Location:
branches/cd/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/cd/src/lib/collision_detection/obb_tree_node.cc

    r7365 r7537  
    1313*/
    1414
    15 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_COLLISION_DETECTION
     15#define DEBUG_SPECIAL_MODULE 3/* DEBUG_MODULE_COLLISION_DETECTION*/
    1616
    1717#include "obb_tree_node.h"
     
    390390  {
    391391    centerOffset[i] = (maxLength[i] + minLength[i]) / 2.0f;       // min length is negatie
    392     box.halfLength[i] = (maxLength[i] - minLength[i]) / 2.0f;      // min length is negative
     392    box.halfLength[i] = (maxLength[i]- minLength[i]) / 2.0f;      // min length is negative
    393393  }
    394394  box.center.x += centerOffset[0];
     
    397397
    398398  PRINTF(3)("\n");
    399   PRINT(3)("\tAxis Length x: %f (max: %11.2f, \tmin: %11.2f)\n", halfLength[0], maxLength[0], minLength[0]);
    400   PRINT(3)("\tAxis Length x: %f (max: %11.2f, \tmin: %11.2f)\n", halfLength[1], maxLength[1], minLength[1]);
    401   PRINT(3)("\tAxis Length x: %f (max: %11.2f, \tmin: %11.2f)\n", halfLength[2], maxLength[2], minLength[2]);
     399  PRINT(3)("\tAxis halflength x: %11.2f (max: %11.2f, \tmin: %11.2f)\n", box.halfLength[0], maxLength[0], minLength[0]);
     400  PRINT(3)("\tAxis halflength x: %11.2f (max: %11.2f, \tmin: %11.2f)\n", box.halfLength[1], maxLength[1], minLength[1]);
     401  PRINT(3)("\tAxis halflength x: %11.2f (max: %11.2f, \tmin: %11.2f)\n", box.halfLength[2], maxLength[2], minLength[2]);
    402402
    403403
     
    809809      if( this->obbTree->getOwner() != NULL)
    810810      {
    811         PRINTF(0)("debug poly draw: depth: %i, mode: %i, entity-name: %s, class: %s\n", depth, drawMode, this->obbTree->getOwner()->getName(), this->obbTree->getOwner()->getClassName());
     811        PRINTF(4)("debug poly draw: depth: %i, mode: %i, entity-name: %s, class: %s\n", depth, drawMode, this->obbTree->getOwner()->getName(), this->obbTree->getOwner()->getClassName());
    812812      }
    813813      else
    814         PRINTF(0)("debug poly draw: depth: %i, mode: %i\n", depth, drawMode);
     814        PRINTF(4)("debug poly draw: depth: %i, mode: %i\n", depth, drawMode);
    815815
    816816
  • branches/cd/src/lib/util/executor/functor_list.h

    r7331 r7537  
    140140
    141141  FUNCTOR_LIST(3)(l_STRING, l_FLOAT, l_UINT);
    142 
     142  FUNCTOR_LIST(4)(l_STRING, l_FLOAT, l_UINT, l_UINT);
    143143
    144144#endif /* FUNCTOR_LIST */
  • branches/cd/src/subprojects/collision_detection/collision_test_entity.cc

    r7535 r7537  
    3434{
    3535  this->init();
    36   this->loadModel(modelName, 1.0f, 0, 2);
     36  this->loadModel(modelName, 1.0f, 0, 3);
     37/*  this->buildObbTree(0);*/
    3738
    38 /*  this->buildObbTree(0);*/
    3939}
    4040
  • branches/cd/src/world_entities/world_entity.cc

    r7365 r7537  
    3636SHELL_COMMAND(model, WorldEntity, loadModel)
    3737->describe("sets the Model of the WorldEntity")
    38 ->defaultValues("models/ships/fighter.obj", 1.0);
     38->defaultValues("models/ships/fighter.obj", 1.0f);
    3939
    4040SHELL_COMMAND(debugEntity, WorldEntity, debugWE);
     
    118118 * @param fileName the name of the model to load
    119119 * @param scaling the Scaling of the model
    120  */
    121 void WorldEntity::loadModel(const std::string& fileName, float scaling, unsigned int modelNumber)
     120 *
     121 * FIXME
     122 * @todo: separate the obb tree generation from the model
     123 */
     124void WorldEntity::loadModel(const std::string& fileName, float scaling, unsigned int modelNumber, unsigned int obbTreeDepth)
    122125{
    123126  this->modelLODName = fileName;
     
    154157
    155158      if( modelNumber == 0)
    156         this->buildObbTree(4);
     159        this->buildObbTree(obbTreeDepth);
    157160    }
    158161    else if(fileName.find(".md2") != std::string::npos)
     
    164167
    165168      if( m != NULL)
    166         this->buildObbTree(4);
     169        this->buildObbTree(obbTreeDepth);
    167170    }
    168171  }
     
    571574    std::string name = getModel( 0 )->getName();
    572575
    573     if (  name.find( ResourceManager::getInstance()->getDataDir() ) == 0 ) 
     576    if (  name.find( ResourceManager::getInstance()->getDataDir() ) == 0 )
    574577    {
    575578      name.erase(ResourceManager::getInstance()->getDataDir().size());
  • branches/cd/src/world_entities/world_entity.h

    r7365 r7537  
    3636  virtual void loadParams(const TiXmlElement* root);
    3737
    38   void loadModel(const std::string& fileName, float scaling = 1.0f, unsigned int modelNumber = 0);
     38  void loadModel(const std::string& fileName, float scaling = 1.0f, unsigned int modelNumber = 0, unsigned int obbTreeDepth = 4);
    3939  void setModel(Model* model, unsigned int modelNumber = 0);
    4040  Model* getModel(unsigned int modelNumber = 0) const { return (this->models.size() > modelNumber)? this->models[modelNumber] : NULL; };
Note: See TracChangeset for help on using the changeset viewer.