Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7958 in orxonox.OLD for branches/cr/src/lib


Ignore:
Timestamp:
May 29, 2006, 5:32:42 PM (19 years ago)
Author:
patrick
Message:

cr: collision reactance introduced

Location:
branches/cr/src/lib
Files:
3 edited

Legend:

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

    r7957 r7958  
    523523      nodeA->registerCollision(nodeA, nodeB, (BoundingVolume*)this->bvElement, (BoundingVolume*)treeNode->bvElement);
    524524    }
    525 
    526 
    527 
    528     /* check if left node overlaps */
    529 //     if( this->nodeLeft != NULL )
    530 //     {
    531 //       PRINTF(5)("Checking OBB %i vs %i: ", this->nodeLeft->getIndex(), treeNode->getIndex());
    532 //       if( this->overlapTest(this->nodeLeft->bvElement, treeNode->bvElement, nodeA, nodeB))
    533 //       {
    534 //         this->nodeLeft->collideWith(treeNode->nodeLeft, nodeA, nodeB);
    535 //         this->nodeLeft->collideWith(treeNode->nodeRight, nodeA, nodeB);
    536 //       }
    537 //     }
    538 
    539     /* check if right node overlaps */
    540 //     if( likely( this->nodeRight != NULL))
    541 //     {
    542 //       PRINTF(5)("Checking OBB %i vs %i: ", this->nodeRight->getIndex(), treeNode->getIndex());
    543 //       if(this->overlapTest(this->nodeRight->bvElement, treeNode->bvElement, nodeA, nodeB))
    544 //       {
    545 //         this->nodeRight->collideWith(treeNode->nodeLeft, nodeA, nodeB);
    546 //         this->nodeRight->collideWith(treeNode->nodeRight, nodeA, nodeB);
    547 //       }
    548 //     }
    549 
    550     /* so there is a collision and this is the last box in the tree (i.e. leaf) */
    551 //     if( unlikely((this->nodeRight == NULL || this->nodeLeft == NULL) ||
    552 //                  (treeNode->nodeRight == NULL || treeNode->nodeLeft == NULL)) )
    553 //     {
    554 //       nodeA->collidesWith(nodeB, treeNode->bvElement->center);
    555 //       nodeB->collidesWith(nodeA, this->bvElement->center);
    556 //       nodeA->registerCollision(nodeA, nodeB, (BoundingVolume*)this->bvElement, (BoundingVolume*)treeNode->bvElement);
    557 //     }
    558525
    559526  }
  • branches/cr/src/lib/collision_reaction/cr_engine.cc

    r7950 r7958  
    5252
    5353  if( this->cachedCollisions.size() != CR_MAX_COLLISIONS)
    54     PRINTF(0)("CollisionReaction Error: cache size missmatch: %i of %i\n", this->cachedCollisions.size(), CR_NUMBER);
     54    PRINTF(0)("CollisionReaction Error: cache size missmatch: %i of %i\n", this->cachedCollisions.size(), CR_MAX_COLLISIONS);
    5555
    5656  this->reset();
     
    5959  for(; it < this->cachedCollisions.end(); it++)
    6060    delete *it;
    61 
    62 //    while( !this->cachedCollisions.empty())
    63 //      delete this->cachedCollisions.back();
    6461
    6562  this->cachedCollisions.clear();
  • branches/cr/src/lib/collision_reaction/cr_engine.h

    r7946 r7958  
    5151
    5252  /** @returns an instance to a collision object. instead of creating new object this ones can be resycled */
    53   inline Collision* popCollisionObject() { if(!this->cachedCollisions.empty()) { this->cachedCollisions.back(); this->cachedCollisions.pop_back();} else return NULL; }
     53  inline Collision* popCollisionObject() { if(!this->cachedCollisions.empty()) { return this->cachedCollisions.back(); this->cachedCollisions.pop_back();} else return NULL; }
    5454  /** @param collision: returns the Collision object back to the cache list */
    5555  inline void pushCollisionObject(Collision* collision) { this->cachedCollisions.push_back(collision); }
Note: See TracChangeset for help on using the changeset viewer.