Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/lib/graphics/spatial_separation/spatial_separation.cc @ 4925

Last change on this file since 4925 was 4923, checked in by patrick, 19 years ago

orxonox/trunk: more cleanup, and more cleanup to come

File size: 2.6 KB
Line 
1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11### File Specific:
12   main-programmer: Patrick Boenzli
13   co-programmer: ...
14*/
15
16#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_SPATIAL_SEPARATION
17
18#include "spatial_separation.h"
19#include "abstract_model.h"
20#include "quadtree.h"
21
22using namespace std;
23
24
25/**
26 *  standard constructor
27 * @param model the model that is to be separated
28 * @param overlapSize each box will overlap for a given size
29
30   The boxes are overlaping because this makes collision detection a lot simpler
31
32 */
33SpatialSeparation::SpatialSeparation (AbstractModel* model, float overlapSize)
34{
35  PRINT(3)("+---------Debug Information SpatialSeparation----------\n");
36  PRINT(3)("+-| (Event) Spatial Separation process kicked on\n");
37
38  this->setClassID(CL_SPATIAL_SEPARATION, "SpatialSeparation");
39  /* debug vice */
40  this->createQuadtree(model);
41}
42
43
44/**
45 *  standard constructor
46 * @param model the model that is to be separated
47 * @param overlapSize each box will overlap for a given size
48
49   The boxes are overlaping because this makes collision detection a lot simpler
50 */
51SpatialSeparation::SpatialSeparation (AbstractModel* model, AbstractModel* playerModel)
52{
53  this->setClassID(CL_SPATIAL_SEPARATION, "SpatialSeparation");
54
55}
56
57
58/**
59 *  standard deconstructor
60 */
61SpatialSeparation::~SpatialSeparation ()
62{
63}
64
65
66/**
67 *  creates a quadtree
68 * @param model the model to do a quadtree on
69 * @param minLength the minimal length of a quadtree node
70 * @return the new quadtree
71 */
72Quadtree* SpatialSeparation::createQuadtree(AbstractModel* model, float minLength)
73{
74  this->minLength = minLength;
75
76}
77
78
79/**
80 *  brief creates a quadtree
81 * @param model the model to do a quadtree on
82 * @param minLength the minimal length of a quadtree node
83 * @return the new quadtree
84 */
85Quadtree* SpatialSeparation::createQuadtree(AbstractModel* model, int treeDepth)
86{
87  this->treeDepth = treeDepth;
88}
89
90
91/**
92 *  creates a quadtree
93 * @param model the model to do a quadtree on
94 * @param minLength the minimal length of a quadtree node
95 * @return the new quadtree
96 */
97Quadtree* SpatialSeparation::createQuadtree(AbstractModel* model)
98{
99  this->quadtree = new Quadtree(model->getModelInfo(), 4);
100
101  return this->quadtree;
102}
103
104
105/**
106 *  draws all the quadtrees
107 */
108void SpatialSeparation::drawQuadtree()
109{
110  if( unlikely( this->quadtree == NULL))
111    return;
112
113  this->quadtree->drawTree();
114}
115
116
117
118
119
120
121
122
123
124
125
126
Note: See TracBrowser for help on using the repository browser.