Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6448 in orxonox.OLD


Ignore:
Timestamp:
Jan 9, 2006, 12:38:12 PM (18 years ago)
Author:
patrick
Message:

collisiondetection: some small changes

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

Legend:

Unmodified
Added
Removed
  • branches/collision_detection/src/lib/collision_detection/obb_tree.cc

    r6447 r6448  
    5858
    5959
    60 
     60/**
     61 *  this function creates a bv tree out of a modelInf structure
     62 * @param modelInf the model info of a model (modelInfo), containing vertices, triangle and normal infos
     63 */
    6164void OBBTree::spawnBVTree(const modelInfo& modelInf)
    6265{
     
    7073  /* triangles indexes created */
    7174  int* triangleIndexes = new int[modelInf.numTriangles];
    72   for(int i = 0; i < modelInf.numTriangles; ++i)
     75  for( int i = 0; i < modelInf.numTriangles; ++i)
    7376    triangleIndexes[i] = i;
    7477
     
    7780
    7881
    79 
    80 
     82/**
     83 *  release the current bv tree if any
     84 */
    8185void OBBTree:: flushTree()
    8286{}
     
    9599
    96100
    97 
     101/**
     102 *  draw bv tree
     103 */
    98104void OBBTree::drawBV(int depth, int drawMode) const
    99105{
     
    105111
    106112
    107 
     113/**
     114 *  some debug output and creation function
     115 *
     116 * doesn't work at the moment
     117 */
    108118void OBBTree::debug()
    109119{
  • branches/collision_detection/src/lib/collision_detection/obb_tree_node.cc

    r6447 r6448  
    688688{
    689689
    690   /* draw the model itself, there is some problem concerning this: the vertices are drawn multiple times */
     690
     691  /* this function can be used to draw the triangles and/or the points only  */
    691692  if( drawMode & DRAW_MODEL || drawMode & DRAW_ALL)
    692693  {
     
    694695    {
    695696      if( drawMode & DRAW_POINTS)
     697      {
    696698        glBegin(GL_POINTS);
    697       for( int i = 0; i < this->bvElement->modelInf->numVertices; i+=3)
    698       {
    699         if( drawMode & DRAW_POINTS)
    700           glVertex3f(this->bvElement->modelInf->pVertices[i], this->bvElement->modelInf->pVertices[i+1], this->bvElement->modelInf->pVertices[i+2]);
    701         else
    702         {
    703           glPushMatrix();
    704           glVertex3f(this->bvElement->modelInf->pVertices[i], this->bvElement->modelInf->pVertices[i+1], this->bvElement->modelInf->pVertices[i+2]);
    705           gluSphere(OBBTreeNode_sphereObj, 0.1, 10, 10);
    706           glPopMatrix();
    707         }
     699        for( int i = 0; i < this->bvElement->modelInf->numVertices*3; i+=3)
     700          glVertex3f(this->bvElement->modelInf->pVertices[i],
     701                     this->bvElement->modelInf->pVertices[i+1],
     702                     this->bvElement->modelInf->pVertices[i+2]);
     703        glEnd();
    708704      }
    709       if( drawMode & DRAW_POINTS)
    710         glEnd();
    711     }
    712   }
    713 
    714   if (top)
     705    }
     706  }
     707/*  if (top)
    715708  {
    716709    glPushAttrib(GL_ENABLE_BIT);
    717710    glDisable(GL_LIGHTING);
    718711    glDisable(GL_TEXTURE_2D);
    719   }
     712  }*/
    720713  glColor3f(color.x, color.y, color.z);
    721714
     
    742735  if( drawMode & DRAW_BV_AXIS || drawMode & DRAW_ALL)
    743736  {
    744     if( !(drawMode & DRAW_SINGLE && depth != 0))
     737    if(1 /*!(drawMode & DRAW_SINGLE && depth != 0)*/)
    745738    {
    746739      /* draw the obb axes */
  • branches/collision_detection/src/lib/collision_detection/obb_tree_node.h

    r6447 r6448  
    11/*!
    22 * @file bv_tree.h
    3   *  Definition of a bounding volume tree
    4 
     3 *  Definition of a bounding volume tree
    54 */
    65
     
    87#define _OBB_TREE_NODE_H
    98
     9
    1010#include "bv_tree_node.h"
    1111
    1212
    13 // forward declarations
    1413class BoundingVolume;
    1514class OBB;
     
    3938    /**  gets the id of the current child @return id of the child */
    4039    inline const int getID() { return this->nextID++; }
     40
    4141
    4242  private:
Note: See TracChangeset for help on using the changeset viewer.