Changeset 4917 in orxonox.OLD for orxonox/trunk/src/lib/graphics
- Timestamp:
- Jul 21, 2005, 12:22:44 PM (19 years ago)
- Location:
- orxonox/trunk/src/lib/graphics/spatial_separation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/spatial_separation/quadtree.cc
r4916 r4917 19 19 #include "quadtree_node.h" 20 20 #include "material.h" 21 #include "vector.h" 21 22 22 23 using namespace std; … … 102 103 103 104 105 QuadtreeNode* Quadtree::getQuadtreeFromPosition(const Vector& position) 106 { 107 Vector v = position; 108 Rectangle* r = this->rootNode->getDimension(); 109 float len = this->nodes[0]->getDimension()->getAxis() * 2.0f; 110 float xOff = r->getCenter()->x - r->getAxis(); 111 float yOff = r->getCenter()->z - r->getAxis(); 112 113 int i = (int)(( position.x - xOff) / len) + 1; 114 int j = (int)(( position.z - yOff) / len) + 1; 115 116 printf("the array coordinates are: %i, %i\n", i, j); 117 } 118 119 104 120 /** 105 121 * draws the debug quadtree boxes around the model -
orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.h
r4911 r4917 30 30 31 31 float getHeight(const Vector& position); 32 Rectangle* getDimension() { return this->pDimension; } 32 33 33 34 void drawTree(int depth, int drawMode) const;
Note: See TracChangeset
for help on using the changeset viewer.