Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4901 in orxonox.OLD


Ignore:
Timestamp:
Jul 19, 2005, 10:35:26 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: added indexing algorithm and material drawing functions

Location:
orxonox/trunk/src/lib/graphics/spatial_separation
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/graphics/spatial_separation/quadtree.cc

    r4898 r4901  
    1818#include "quadtree.h"
    1919#include "quadtree_node.h"
     20#include "material.h"
    2021
    2122using namespace std;
     
    3132   this->pModelInfo = pModelInfo;
    3233   this->treeDepth = treeDepth;
     34
     35   this->materials = new Material*[4];
     36
     37   for(int i = 0; i < 4; ++i)
     38   {
     39     materials[i] = new Material();
     40     materials[i]->setIllum(3);
     41   }
     42   materials[0]->setAmbient(0.0, 0.3, 0.0);
     43   materials[1]->setAmbient(0.4, 0.0, 0.2);
     44   materials[2]->setAmbient(1.0, 0.0, 0.0);
     45   materials[3]->setAmbient(5.0, 3.0, 1.0);
     46
    3347
    3448   this->rootNode = new QuadtreeNode(this->pModelInfo, this->treeDepth);
  • orxonox/trunk/src/lib/graphics/spatial_separation/quadtree.h

    r4900 r4901  
    2525  void drawTree(int depth, int drawMode) const;
    2626
     27  Material* getMaterial(int indexNode) { return this->materials[indexNode%4]; }
     28
    2729 private:
    2830   QuadtreeNode*                   rootNode;              //!< reference to the root node of the quadtree
    2931   modelInfo*                      pModelInfo;            //!< reference to the modelInfo of the object
    3032   int                             treeDepth;             //!< depth of the tree
     33
     34   Material**                       materials;            //!< materials for debug drawing purposes
    3135};
    3236
Note: See TracChangeset for help on using the changeset viewer.