Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4695 in orxonox.OLD for orxonox/trunk/src/lib/collision_detection


Ignore:
Timestamp:
Jun 24, 2005, 11:15:12 PM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: no only the overlap test is missing

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

Legend:

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

    r4635 r4695  
    1414// FORWARD DEFINITION
    1515class BoundingVolume;
     16class BVTreeNode;
    1617
    1718typedef enum DrawMode
     
    3839  virtual void flushTree() = NULL;
    3940
     41  virtual void collideWith(BVTree* tree) = NULL;
     42
    4043  virtual void drawBV(int depth, int drawMode) const = NULL;
     44
    4145
    4246 protected:
  • orxonox/trunk/src/lib/collision_detection/bv_tree_node.h

    r4635 r4695  
    2929  inline const int getIndex() { return this->treeIndex; }
    3030
    31   virtual void collideWith(const BVTree &tree) = NULL;
     31  virtual void collideWith(BVTreeNode* treeNode) = NULL;
    3232
    3333  virtual void drawBV(int depth, int drawMode) const = NULL;
  • orxonox/trunk/src/lib/collision_detection/cd_engine.cc

    r4694 r4695  
    5454
    5555
     56/**
     57  \brief this is the collision checking function
     58
     59  there are some speed improvements that can be done here. a rewrite of the list a would be appropriate to
     60  be able to enhance iteration speed.
     61 */
    5662void CDEngine::checkCollisions()
    5763{
  • orxonox/trunk/src/lib/collision_detection/obb_tree.cc

    r4682 r4695  
    103103
    104104
    105 void OBBTree::collideWith(const OBBTree &tree)
    106 {}
     105void OBBTree::collideWith(BVTree* tree)
     106{
     107  //this->rootNode->collideWith(tree->);
     108}
    107109
    108110
  • orxonox/trunk/src/lib/collision_detection/obb_tree.h

    r4682 r4695  
    2727    virtual void flushTree();
    2828
    29     void collideWith(const OBBTree &tree);
     29    virtual void collideWith(BVTree* tree);
    3030
    3131    virtual void drawBV(int depth, int drawMode) const;
  • orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc

    r4688 r4695  
    530530  tList<sVec3D>      partition2;                           //!< the vertex partition 2
    531531
    532   printf("vertex index: %i, of %i\n", vertexIndex, box->numOfVertices);
     532  PRINTF(3)("vertex index: %i, of %i\n", vertexIndex, box->numOfVertices);
    533533  this->separationPlane = new Plane(box->axis[axisIndex], box->vertices[vertexIndex]);  //!< separation plane
    534534  this->sepPlaneCenter = &box->vertices[vertexIndex];
     
    604604
    605605
    606 void OBBTreeNode::collideWith(const BVTree &tree)
    607 {}
    608 
    609 
     606void OBBTreeNode::collideWith(BVTreeNode* treeNode)
     607{
     608  /* if the obb overlap, make subtests: check which node is realy overlaping  */
     609  if( this->overlapTest(this->bvElement, ((OBBTreeNode*)treeNode)->bvElement))
     610  {
     611    /* check if left node overlaps */
     612    if( unlikely( this->nodeLeft != NULL))
     613      if( this->overlapTest(this->nodeLeft->bvElement, ((OBBTreeNode*)treeNode)->bvElement))
     614        this->nodeLeft->collideWith(((OBBTreeNode*)treeNode)->nodeLeft);
     615    /* check if right node overlaps */
     616    if( unlikely( this->nodeRight != NULL))
     617      if(this->overlapTest(this->nodeRight->bvElement, ((OBBTreeNode*)treeNode)->bvElement))
     618        this->nodeLeft->collideWith(((OBBTreeNode*)treeNode)->nodeRight);
     619  }
     620}
     621
     622
     623
     624bool OBBTreeNode::overlapTest(OBB* boxA, OBB* boxB)
     625{
     626
     627}
    610628
    611629
  • orxonox/trunk/src/lib/collision_detection/obb_tree_node.h

    r4685 r4695  
    3333    inline void setTreeRef(OBBTree* tree) { this->obbTree = tree;}
    3434
    35     virtual void collideWith(const BVTree &tree);
     35    virtual void collideWith(BVTreeNode* treeNode);
    3636
    3737    virtual void drawBV(int depth, int drawMode) const;
     
    4545    void forkBox(OBB* box);
    4646
     47    bool overlapTest(OBB* boxA, OBB* boxB);
    4748
    4849  protected:
Note: See TracChangeset for help on using the changeset viewer.