Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4896 in orxonox.OLD for orxonox/trunk


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

orxonox/trunk: extended the constructor interface to force the specification of a parent Node

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

Legend:

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

    r4889 r4896  
    2828*/
    2929QuadtreeNode::QuadtreeNode (sTriangleExt** triangles, int numTriangles,
    30                             const float* pVertices, int numVertices, Quadtree* quadtree)
     30                            const float* pVertices, int numVertices,
     31                            Quadtree* quadtree, QuadtreeNode* parent)
    3132{
    3233  this->pTriangles = triangles;
     
    3637  this->quadtree = quadtree;
    3738  this->treeDepth = 0;
    38 
    39 //   this->pDimension = this->getDimension();
     39  this->parent = parent;
     40
    4041  this->init();
    4142}
     
    5859  this->treeDepth = 0;
    5960
    60 //   this->pDimension = this->getDimension(this->pModelInfo);
    6161  this->init();
    6262}
     
    7171
    7272  this->offset = 0.0f;
     73  this->parent = NULL;
    7374  this->nodeA = NULL;
    7475  this->nodeB = NULL;
     
    245246
    246247  /* now propagate */
    247   this->nodeA = new QuadtreeNode(pTriA, lenA, this->pVertices, this->numVertices, this->quadtree);
    248   this->nodeB = new QuadtreeNode(pTriB, lenB, this->pVertices, this->numVertices, this->quadtree);
    249   this->nodeC = new QuadtreeNode(pTriC, lenC, this->pVertices, this->numVertices, this->quadtree);
    250   this->nodeD = new QuadtreeNode(pTriD, lenD, this->pVertices, this->numVertices, this->quadtree);
     248  this->nodeA = new QuadtreeNode(pTriA, lenA, this->pVertices, this->numVertices, this->quadtree, this);
     249  this->nodeB = new QuadtreeNode(pTriB, lenB, this->pVertices, this->numVertices, this->quadtree, this);
     250  this->nodeC = new QuadtreeNode(pTriC, lenC, this->pVertices, this->numVertices, this->quadtree, this);
     251  this->nodeD = new QuadtreeNode(pTriD, lenD, this->pVertices, this->numVertices, this->quadtree, this);
    251252}
    252253
  • orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.h

    r4887 r4896  
    2121  public:
    2222    QuadtreeNode(sTriangleExt** triangles, int numTriangles,
    23                  const float* pVertices, int numVertices, Quadtree* quadtree);
     23                 const float* pVertices, int numVertices,
     24                 Quadtree* quadtree, QuadtreeNode* parent);
    2425    QuadtreeNode(modelInfo* pModelInfo);
    2526    virtual ~QuadtreeNode();
     
    3637    Rectangle* getDimension(modelInfo* pModelInfo);
    3738    Rectangle* getDimension();
     39
     40
     41  protected:
     42    QuadtreeNode*                   parent;             //!< reference to the paren QuadtreeNode (NULL if rootnode)
     43    QuadtreeNode*                   nodeA;              //!< reference to the node A
     44    QuadtreeNode*                   nodeB;              //!< reference to the node B
     45    QuadtreeNode*                   nodeC;              //!< reference to the node C
     46    QuadtreeNode*                   nodeD;              //!< reference to the node D
    3847
    3948  private:
     
    5261    modelInfo*                      pModelInfo;         //!< reference to the modelInfo of the object
    5362    Rectangle*                      pDimension;         //!< pointer to the local rectangle properties
    54 
    55     QuadtreeNode*                   nodeA;              //!< reference to the node A
    56     QuadtreeNode*                   nodeB;              //!< reference to the node B
    57     QuadtreeNode*                   nodeC;              //!< reference to the node C
    58     QuadtreeNode*                   nodeD;              //!< reference to the node D
    59 
    6063};
    6164
Note: See TracChangeset for help on using the changeset viewer.