Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5028 in orxonox.OLD for orxonox


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

orxonox/trunk: changed the collision detection interface again slightly to make it more useable

Location:
orxonox/trunk/src/lib/collision_detection
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/collision_detection/bv_tree.h

    r5026 r5028  
    4242  virtual void flushTree() = NULL;
    4343
    44   virtual void collideWith(BVTree* tree, PNode* nodeA, PNode* nodeB) = NULL;
     44  virtual void collideWith(BVTree* tree, WorldEntity* nodeA, WorldEntity* nodeB) = NULL;
    4545  virtual void collideWith(WorldEntity* entity1, WorldEntity* entity2) = NULL;
    4646
  • orxonox/trunk/src/lib/collision_detection/bv_tree_node.h

    r4836 r5028  
    1515class BVTree;
    1616class PNode;
     17class WorldEntity;
    1718template<class T> class tList;
    1819
     
    2930  inline const int getIndex() { return this->treeIndex; }
    3031
    31   virtual void collideWith(BVTreeNode* treeNode, PNode* nodeA, PNode* nodeB) = NULL;
     32  virtual void collideWith(BVTreeNode* treeNode, WorldEntity* nodeA, WorldEntity* nodeB) = NULL;
    3233
    3334  virtual void drawBV(int depth, int drawMode) = NULL;
  • orxonox/trunk/src/lib/collision_detection/obb_tree.cc

    r5027 r5028  
    113113{
    114114  if( likely(entity2->getOBBTree() != NULL) )
    115     this->rootNode->collideWith(((OBBTree*)entity2->getOBBTree())->getRootNode(), (PNode*)entity1, (PNode*)entity2);
     115    this->rootNode->collideWith(((OBBTree*)entity2->getOBBTree())->getRootNode(), entity1, entity2);
    116116}
    117117
     
    123123 * @param nodeB: Pnode of object B
    124124 */
    125 void OBBTree::collideWith(BVTree* tree, PNode* nodeA, PNode* nodeB)
     125void OBBTree::collideWith(BVTree* tree, WorldEntity* nodeA, WorldEntity* nodeB)
    126126{
    127127  this->rootNode->collideWith(((OBBTree*)tree)->getRootNode(), nodeA, nodeB);
  • orxonox/trunk/src/lib/collision_detection/obb_tree.h

    r5026 r5028  
    2828    virtual void flushTree();
    2929
    30     virtual void collideWith(BVTree* tree, PNode* nodeA, PNode* nodeB);
     30    virtual void collideWith(BVTree* tree, WorldEntity* nodeA, WorldEntity* nodeB);
    3131    virtual void collideWith(WorldEntity* entity1, WorldEntity* entity2);
    3232
  • orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc

    r4836 r5028  
    2222#include "vector.h"
    2323#include "abstract_model.h"
    24 #include "p_node.h"
     24#include "world_entity.h"
    2525
    2626#include <math.h>
     
    620620
    621621
    622 void OBBTreeNode::collideWith(BVTreeNode* treeNode, PNode* nodeA, PNode* nodeB)
     622void OBBTreeNode::collideWith(BVTreeNode* treeNode, WorldEntity* nodeA, WorldEntity* nodeB)
    623623{
    624624  PRINTF(3)("collideWith\n");
     
    647647       this->nodeRight->collideWith(((OBBTreeNode*)treeNode)->nodeRight, nodeA, nodeB);
    648648      }
    649     }
    650   }
    651 }
    652 
    653 
    654 
    655 bool OBBTreeNode::overlapTest(OBB* boxA, OBB* boxB, PNode* nodeA, PNode* nodeB)
     649
     650      /* so there is a collision and this is the last box in the tree (i.e. leaf) */
     651      if( unlikely(this->nodeRight == NULL && this->nodeLeft == NULL))
     652      {
     653        //nodeA->collidesWith()
     654      }
     655    }
     656  }
     657}
     658
     659
     660
     661bool OBBTreeNode::overlapTest(OBB* boxA, OBB* boxB, WorldEntity* nodeA, WorldEntity* nodeB)
    656662{
    657663  /* first check all axis */
  • orxonox/trunk/src/lib/collision_detection/obb_tree_node.h

    r4836 r5028  
    3434    inline void setTreeRef(OBBTree* tree) { this->obbTree = tree;}
    3535
    36     virtual void collideWith(BVTreeNode* treeNode, PNode* nodeA, PNode* nodeB);
     36    virtual void collideWith(BVTreeNode* treeNode, WorldEntity* nodeA, WorldEntity* nodeB);
    3737
    3838    virtual void drawBV(int depth, int drawMode);
     
    4646    void forkBox(OBB* box);
    4747
    48     bool overlapTest(OBB* boxA, OBB* boxB, PNode* nodeA, PNode* nodeB);
     48    bool overlapTest(OBB* boxA, OBB* boxB, WorldEntity* nodeA, WorldEntity* nodeB);
    4949
    5050  protected:
Note: See TracChangeset for help on using the changeset viewer.