Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 23, 2005, 12:31:47 AM (19 years ago)
Author:
patrick
Message:

collision_detection: work flush

Location:
branches/collision_detection/src/world_entities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/collision_detection/src/world_entities/world_entity.cc

    r5713 r5717  
    104104  }
    105105  else
    106     this->model = NULL;
     106  {
     107        this->model = NULL;
     108        this->obbTree = NULL;
     109  }
    107110}
    108111
     
    113116bool WorldEntity::buildObbTree(unsigned int depth)
    114117{
    115   if (this->obbTree)
    116     delete this->obbTree;
    117 
    118   if (this->model != NULL)
    119   {
     118  if( this->model != NULL) {
    120119    PRINTF(4)("creating obb tree\n");
    121 
    122 
    123120    //this->obbTree = new OBBTree(depth, (sVec3D*)this->model->getVertexArray(), this->model->getVertexCount());
    124121    this->obbTree = new OBBTree(depth, *model->getModelInfo());
     
    127124  else
    128125  {
    129     PRINTF(2)("could not create obb-tree, because no model was loaded yet\n");
     126    PRINTF(1)("could not create obb-tree, because no model was loaded yet\n");
    130127    this->obbTree = NULL;
    131128    return false;
  • branches/collision_detection/src/world_entities/world_entity.h

    r5511 r5717  
    4747  void drawBVTree(unsigned int depth, int drawMode) const;
    4848  /** @returns a reference to the obb tree of this worldentity */
    49   BVTree* getOBBTree() const { return this->obbTree; };
     49  inline const BVTree* getOBBTree() const { return this->obbTree; };
    5050
    5151  /* @returns the Count of Faces on this WorldEntity */
     
    5959 protected:
    6060  Model*                  model;            //!< The model that should be loaded for this entity.
    61   BVTree*                 obbTree;          //!< this is the obb tree reference needed for collision detection
     61  const BVTree*           obbTree;          //!< this is the obb tree reference needed for collision detection
    6262  //  CharacterAttributes*    charAttr;         //!< the character attributes of a world_entity
    6363
Note: See TracChangeset for help on using the changeset viewer.