Changeset 9092 in orxonox.OLD for branches/presentation/src/lib/graphics
- Timestamp:
- Jul 4, 2006, 2:38:00 AM (18 years ago)
- Location:
- branches/presentation/src/lib/graphics
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/presentation/src/lib/graphics/importer/primitive_model.cc
r8316 r9092 18 18 #include "primitive_model.h" 19 19 20 #include <math.h>21 20 #include "vector.h" 22 21 #include "debug.h" -
branches/presentation/src/lib/graphics/spatial_separation/quadtree.cc
r8293 r9092 52 52 53 53 /* make an array with access to the leafs of the Quad-Tree */ 54 this->nodes = new QuadtreeNode*[(int)pow(4 , treeDepth)];54 this->nodes = new QuadtreeNode*[(int)pow(4.0, treeDepth)]; 55 55 int index = 0; //new int; *index = 0; // !!changed by bensch!! 56 for(int i = 0; i < (int)pow(2 , treeDepth); ++i)56 for(int i = 0; i < (int)pow(2.0, treeDepth); ++i) 57 57 { 58 58 this->rootNode->buildHashTable(this->nodes, &index); … … 70 70 this->offset->x = xOff; 71 71 this->offset->z = yOff; 72 this->maxIndex = (int)pow(2 , this->treeDepth);72 this->maxIndex = (int)pow(2.0, this->treeDepth); 73 73 } 74 74 … … 103 103 void Quadtree::revertHashTable(QuadtreeNode** nodes) 104 104 { 105 int len = (int)pow(2 , this->treeDepth); //!< the length of a quadtree side105 int len = (int)pow(2.0, this->treeDepth); //!< the length of a quadtree side 106 106 int iterator = 0; //!< iterator used for mapping 107 107 QuadtreeNode* tmpNode = NULL; //!< temp saving place … … 132 132 void Quadtree::sortHashTable(QuadtreeNode** nodes) 133 133 { 134 int len = (int)pow(2 , this->treeDepth); //!< the length of a quadtree side134 int len = (int)pow(2.0, this->treeDepth); //!< the length of a quadtree side 135 135 float a; //!< temp place for float a 136 136 float b; //!< temp place for float b … … 207 207 { 208 208 //this->rootNode->drawTree(); 209 for(int i = 0; i < (int)pow(4 , this->treeDepth); ++i)209 for(int i = 0; i < (int)pow(4.0, this->treeDepth); ++i) 210 210 { 211 211 this->nodes[i]->draw(); -
branches/presentation/src/lib/graphics/spatial_separation/quadtree_node.cc
r6022 r9092 164 164 165 165 /* offset #of elements in a row #of rows in a quadtree */ 166 int threshold = this->nodeIter + (int)pow(2 , this->maxDepth) * (int)pow(2, maxDepth - treeDepth - 1);166 int threshold = this->nodeIter + (int)pow(2.0, this->maxDepth) * (int)pow(2.0, maxDepth - treeDepth - 1); 167 167 int loopLimit = (*index < threshold)?2:4; 168 168
Note: See TracChangeset
for help on using the changeset viewer.