Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4852 in orxonox.OLD for orxonox/trunk/src/lib


Ignore:
Timestamp:
Jul 13, 2005, 9:58:40 PM (19 years ago)
Author:
patrick
Message:

split the constructor into init and both constr. some debug output

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

Legend:

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

    r4845 r4852  
    4949 */
    5050void Quadtree::separate()
    51 {}
     51{
     52  this->rootNode->separateNode();
     53}
    5254
    5355
  • orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.cc

    r4851 r4852  
    2828QuadtreeNode::QuadtreeNode (sTriangleExt* triangles, int numTriangles, Quadtree* quadtree)
    2929{
    30    this->setClassID(CL_QUADTREE_NODE, "QuadtreeNode");
     30  this->init();
    3131}
    3232
     
    4646  for( int i = 0; i < this->pModelInfo->numTriangles; ++i)
    4747    this->pTriangles[i] = &this->pModelInfo->pTriangles[i];
    48  
     48
     49  this->init();
     50}
     51
     52
     53/**
     54 * takes the rest of the initialisation process
     55 */
     56void QuadtreeNode::init()
     57{
     58  PRINTF(0)("Creating QuadtreeNode\n");
     59  this->setClassID(CL_QUADTREE_NODE, "QuadtreeNode");
     60
     61  this->offset = 0.0f;
    4962}
    5063
     
    5265/**
    5366 *  standard deconstructor
    54 
    55 */
     67 */
    5668QuadtreeNode::~QuadtreeNode ()
    5769{
     
    6476 */
    6577void QuadtreeNode::separateNode(int treeDepth)
    66 {}
     78{
     79  this->separateNode();
     80}
    6781
    6882
     
    7286*/
    7387void QuadtreeNode::separateNode(float minLength)
    74 {}
     88{
     89  this->separateNode();
     90}
    7591
    7692
     
    8197void QuadtreeNode::separateNode()
    8298{
     99  PRINTF(0)("got command to separate node\n");
    83100  tList<sTriangleExt*>*           listA = new tList<sTriangleExt*>();    //!< triangle list of nodeA
    84101  tList<sTriangleExt*>*           listB = new tList<sTriangleExt*>();    //!< triangle list of nodeB
     
    95112          pVert = &this->pVertices[this->pTriangles[i]->indexToVertices[j]];
    96113          if(  pVert[0] > rectCenter->x + this->offset && pVert[2] > rectCenter->z + this->offset)
    97             printf("");
    98 
     114            printf("nA");
     115          if( pVert[0] > rectCenter->x + this->offset && pVert[2]< rectCenter->z + this->offset)
     116            printf("nB");
     117          if( pVert[0] < rectCenter->x + this->offset && pVert[2] > rectCenter->z + this->offset)
     118            printf("nC");
     119          if( pVert[0] < rectCenter->x + this->offset && pVert[2] < rectCenter->z + this->offset)
     120            printf("nD");
    99121        }
    100122    }
     123  PRINTF(0)("\nseparation complete\n");
    101124}
    102125
  • orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.h

    r4851 r4852  
    3232
    3333  private:
     34    void init();
    3435    Rectangle* getDimension(modelInfo* pModelInfo);
    3536
  • orxonox/trunk/src/lib/graphics/spatial_separation/spatial_separation.cc

    r4845 r4852  
    3333SpatialSeparation::SpatialSeparation (AbstractModel* model, float overlapSize)
    3434{
     35  PRINTF(0)("Spatial Separation process kicked on\n");
    3536   this->setClassID(CL_SPATIAL_SEPARATION, "SpatialSeparation");
     37   /* debug vice */
    3638   this->createQuadtree(model);
    3739}
Note: See TracChangeset for help on using the changeset viewer.