Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4810 in orxonox.OLD for orxonox/trunk/src/lib


Ignore:
Timestamp:
Jul 7, 2005, 2:15:18 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: prepearing the quadtree framework to process

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

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/graphics/spatial_separation/quadtree.h

    r4805 r4810  
    1010
    1111#include "base_object.h"
     12#include "vector.h"
     13
     14class QuadtreeNode;
    1215
    1316//! A class for quadtree separation of the world
     
    2023
    2124 private:
     25   QuadtreeNode*                   rootNode;
     26
    2227
    2328};
  • orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.h

    r4805 r4810  
    99
    1010#include "base_object.h"
    11 
     11#include "vector.h"
    1212// FORWARD DEFINITION
    1313
    14 
     14class QuadtreeNode;
    1515
    1616//! A class for a Quadtree Node representation
     
    2323
    2424 private:
     25   Vector                          center;             //!< center coordinate of the quadtree node - relative coordinates in model space(!)
     26   float                           axisLength;         //!< axis length of the quadtree
     27   float                           maxHeigth;          //!< max height of the model in the quadtree
    2528
     29   QuadtreeNode*                   nodeA;              //!< reference to the node A
     30   QuadtreeNode*                   nodeB;              //!< reference to the node B
     31   QuadtreeNode*                   nodeC;              //!< reference to the node C
     32   QuadtreeNode*                   nodeD;              //!< reference to the node D
    2633};
    2734
  • orxonox/trunk/src/lib/graphics/spatial_separation/spatial_separation.cc

    r4809 r4810  
    2424/**
    2525   \brief standard constructor
    26    \todo this constructor is not jet implemented - do it
     26   \param model the model that is to be separated
     27   \param overlapSize each box will overlap for a given size
     28
     29   The boxes are overlaping because this makes collision detection a lot simpler
     30
    2731*/
    28 SpatialSeparation::SpatialSeparation ()
     32SpatialSeparation::SpatialSeparation (AbstractModel* model, float overlapSize)
    2933{
    3034   this->setClassID(CL_SPATIAL_SEPARATION, "SpatialSeparation");
     35
     36}
     37
     38/**
     39   \brief standard constructor
     40   \param model the model that is to be separated
     41   \param overlapSize each box will overlap for a given size
     42
     43   The boxes are overlaping because this makes collision detection a lot simpler
     44
     45 */
     46SpatialSeparation::SpatialSeparation (AbstractModel* model, AbstractModel* playerModel)
     47{
     48  this->setClassID(CL_SPATIAL_SEPARATION, "SpatialSeparation");
    3149
    3250}
  • orxonox/trunk/src/lib/graphics/spatial_separation/spatial_separation.h

    r4809 r4810  
    11/*!
    22    \file spatial_separation.h
    3     \brief Definition of the generic spatial separation of model data
     3    \brief Definition of the generic spatial separation process of model data
    44
    55 */
     
    1919
    2020  public:
    21     SpatialSeparation();
     21    SpatialSeparation(AbstractModel* model, float overlapSize);
     22    SpatialSeparation(AbstractModel* model, AbstractModel* playerModel);
    2223    virtual ~SpatialSeparation();
    2324
     25    void setTreeDepth(int depth) { this->treeDepth = depth; }
     26    void setMinLength(int minLength) { this->minLength = minLength; }
     27
     28    Quadtree* createQuadtree(AbstractModel* model, float minLength);
     29    Quadtree* createQuadtree(AbstractModel* model, int treeDepth);
    2430    Quadtree* createQuadtree(AbstractModel* model);
    2531
    2632
    2733  private:
    28     AbstractModel*             model;
     34    void separateZone();
    2935
    3036
     37  private:
     38    AbstractModel*             model;        //!< the reference to the model that has to be handled
     39    Quadtree*                  quadtree;     //!< the reference to the created quadtree
     40
     41    AbstractModel*             playerModel;  //!< referece to the player model, if needed for overlap calculations
     42    float                      overlapSize;  //!< the size of overlaping
     43
     44    int                        treeDepth;    //!< depth of the quadtree
     45    float                      minLength;    //!< min length of a quadtree node
    3146};
    3247
Note: See TracChangeset for help on using the changeset viewer.