Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4917 in orxonox.OLD for orxonox/trunk/src/lib/graphics


Ignore:
Timestamp:
Jul 21, 2005, 12:22:44 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: some very little cleanup in the World - make it a better place

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  
    1919#include "quadtree_node.h"
    2020#include "material.h"
     21#include "vector.h"
    2122
    2223using namespace std;
     
    102103
    103104
     105QuadtreeNode* 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
    104120/**
    105121 *  draws the debug quadtree boxes around the model
  • orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.h

    r4911 r4917  
    3030
    3131    float getHeight(const Vector& position);
     32    Rectangle* getDimension() { return this->pDimension; }
    3233
    3334    void drawTree(int depth, int drawMode) const;
Note: See TracChangeset for help on using the changeset viewer.