Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 13, 2005, 6:25:54 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: drawing in diffrent hirarchies works now, with diffrent colors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/collision_detection/obb_tree.cc

    r4618 r4622  
    2626
    2727
    28 Material* OBBTree::material = NULL;
    29 
    3028/**
    3129   \brief standard constructor
     
    3432{
    3533  this->setClassID(CL_OBB_TREE, "OBBTree");
    36   material = new Material("Tree");
    37   material->setIllum(3);
    38   material->setAmbient(1.0, 1.0, 1.0);
     34
     35  material = new Material*[3];
     36  for(int i = 0; i < 3; ++i)
     37  {
     38    material[i] = new Material();
     39    material[i]->setIllum(0);
     40  }
     41  material[0]->setAmbient(0.0, 0.3, 0.0);
     42  material[1]->setAmbient(0.0, 0.0, 0.2);
     43  material[2]->setAmbient(1.0, 0.0, 0.0);
    3944}
    4045
     
    5964  OBBTreeNode* node = new OBBTreeNode();
    6065  this->rootNode = node;
     66  this->rootNode->setTreeRef(this);
    6167  this->rootNode->spawnBVTree(depth, verticesList, length);
    6268}
     
    7177
    7278
    73 void OBBTree::drawBV(int currentDepth, const int depth) const
     79void OBBTree::drawBV(int depth) const
    7480{
    7581  if( likely(this->rootNode != NULL))
    7682  {
    77     this->rootNode->drawBV(currentDepth);
    78     this->rootNode->drawBVPolygon(currentDepth);
     83    this->rootNode->drawBV(depth);
     84    this->rootNode->drawBVPolygon(depth);
    7985  }
    8086}
    8187
    8288
    83 void OBBTree::drawBVPolygon(int currentDepth, const int depth) const
     89void OBBTree::drawBVPolygon(int depth) const
    8490{
    8591  if( likely(this->rootNode != NULL))
    86     this->rootNode->drawBVPolygon(currentDepth);
     92    this->rootNode->drawBVPolygon(depth);
    8793}
    8894
    8995
    90 void OBBTree::drawBVBlended(int currentDepth, const int depth) const
     96void OBBTree::drawBVBlended(int depth) const
    9197{
    9298  if( likely(this->rootNode != NULL))
    93     this->rootNode->drawBVBlended(currentDepth);
     99    this->rootNode->drawBVBlended(depth);
    94100}
    95101
Note: See TracChangeset for help on using the changeset viewer.