Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8507 in orxonox.OLD for branches/bsp_model/src


Ignore:
Timestamp:
Jun 15, 2006, 11:34:52 PM (18 years ago)
Author:
patrick
Message:

bsp: added a new aabb (axis aligned bounding box) for each model to measure the model size in each direction and its center

Location:
branches/bsp_model/src
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • branches/bsp_model/src/defs/class_id.h

    r8490 r8507  
    278278  CL_OBB                        =    0x00720000,
    279279  CL_BOUNDING_SPHERE            =    0x00740000,
     280  CL_AABB_TREE_NODE             =    0x00000724,                //FIXME: is this correct? AABB_TREE_NODE isA BOUNDING_VOLUME
    280281
    281282
  • branches/bsp_model/src/lib/collision_detection/Makefile.am

    r8190 r8507  
    1111                     bv_tree_node.cc \
    1212                     bounding_volume.cc \
    13                      bounding_sphere.cc
     13                     bounding_sphere.cc \
     14                     aabb_tree_node.cc
    1415
    1516
     
    2223                     bv_tree_node.h \
    2324                     bounding_volume.h \
    24                      bounding_sphere.h
     25                     bounding_sphere.h \
     26                     aabb_tree_node.h
    2527
  • branches/bsp_model/src/world_entities/creatures/md2_creature.cc

    r8504 r8507  
    301301  if( bMouseMotion)
    302302  {
    303     PRINTF(0)("motion\n");
    304303    this->mouseDirX *= Quaternion(-M_PI / 4.0f * this->xMouse*mouseSensitivity, Vector(0,1,0));
    305304    this->mouseDirY *= Quaternion(-M_PI / 4.0f * this->yMouse*mouseSensitivity, Vector(0,0,1));
  • branches/bsp_model/src/world_entities/world_entity.cc

    r8490 r8507  
    2424#include "md3/md3_model.h"
    2525
     26#include "aabb_tree_node.h"
     27
    2628#include "util/loading/resource_manager.h"
    2729#include "util/loading/load_param.h"
     
    6062
    6163  this->obbTree = NULL;
     64  this->aabbNode = NULL;
    6265  this->healthWidget = NULL;
    6366  this->healthMax = 1.0f;
     
    240243
    241244  this->models[modelNumber] = model;
    242 
    243 
    244   //   if (this->model != NULL)
    245   //     this->buildObbTree(4);
    246245}
    247246
     
    257256
    258257  if (this->models[0] != NULL)
    259   {
    260258    this->obbTree = new OBBTree(depth, models[0]->getModelInfo(), this);
    261     return true;
    262   }
    263259  else
    264260  {
     
    267263    return false;
    268264  }
     265
     266
     267  // create the axis aligned bounding box
     268  if( this->aabbNode != NULL)
     269  {
     270    delete this->aabbNode;
     271    this->aabbNode = NULL;
     272  }
     273
     274  if( this->models[0] != NULL) {
     275    this->aabbNode = new AABBTreeNode();
     276    this->aabbNode->spawnBVTree(this->models[0]);
     277  }
     278  return true;
    269279}
    270280
     
    604614      this->models[0]->draw();
    605615    }
     616
     617    if( this->aabbNode != NULL)
     618      this->aabbNode->drawBV(0, DRAW_BV_POLYGON, Vector(1, 0.6, 0.2), true);
     619
    606620    glPopMatrix();
    607621  }
  • branches/bsp_model/src/world_entities/world_entity.h

    r8490 r8507  
    2626class BVTree;
    2727class BoundingVolume;
     28class AABBTreeNode;
    2829class Model;
    2930class CollisionHandle;
     
    167168  std::string             modelLODName;       //!< the name of the model lod file
    168169  BVTree*                 obbTree;            //!< this is the obb tree reference needed for collision detection
     170  AABBTreeNode*           aabbNode;           //!< the tree node of the first level of a axis aligned bounding boxes tree: model dimension
    169171
    170172  bool                    bCollide;           //!< If it should be considered for the collisiontest.
Note: See TracChangeset for help on using the changeset viewer.