Changeset 5215 in orxonox.OLD for trunk/src/lib/graphics/spatial_separation/quadtree.cc
- Timestamp:
- Sep 22, 2005, 4:02:08 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/spatial_separation/quadtree.cc
r5075 r5215 53 53 /* make an array with access to the leafs of the Quad-Tree */ 54 54 this->nodes = new QuadtreeNode*[(int)pow(4, treeDepth)]; 55 int * index = new int; *index = 0;55 int index = 0; //new int; *index = 0; // !!changed by bensch!! 56 56 for(int i = 0; i < (int)pow(2, treeDepth); ++i) 57 57 { 58 this->rootNode->buildHashTable(this->nodes, index);58 this->rootNode->buildHashTable(this->nodes, &index); 59 59 } 60 60 /* sort and revert the hash table to fit the right position */ … … 65 65 this->quadLength = this->nodes[0]->getDimension()->getAxis() * 2.0f; 66 66 Rectangle* r = this->rootNode->getDimension(); 67 Vector* offset = new Vector();68 float xOff = r->getCenter() ->x - r->getAxis();69 float yOff = r->getCenter() ->z - r->getAxis();67 // Vector* offset = new Vector(); // unused removed by bensch 68 float xOff = r->getCenter().x - r->getAxis(); 69 float yOff = r->getCenter().z - r->getAxis(); 70 70 this->offset = new Vector(); 71 71 this->offset->x = xOff; … … 136 136 for( int k = j + 1; k < len; ++k) 137 137 { 138 a = this->nodes[i * len + j]->getDimension()->getCenter() ->z;139 b = this->nodes[i * len + k]->getDimension()->getCenter() ->z;138 a = this->nodes[i * len + j]->getDimension()->getCenter().z; 139 b = this->nodes[i * len + k]->getDimension()->getCenter().z; 140 140 141 141 if( b > a)
Note: See TracChangeset
for help on using the changeset viewer.