Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/lib/collision_detection/obb_tree_node.h @ 4618

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

orxonox/trunk: the obb tree now gets rendered correctly

File size: 1.6 KB
Line 
1/*!
2    \file bv_tree.h
3    \brief Definition of a bounding volume tree
4
5 */
6
7#ifndef _OBB_TREE_NODE_H
8#define _OBB_TREE_NODE_H
9
10#include "bv_tree_node.h"
11
12
13
14// FORWARD DEFINITION
15class BoundingVolume;
16class OBB;
17//struct sVec3D;
18
19//! A class that represents a bounding volume tree
20class OBBTreeNode : public BVTreeNode {
21
22
23  public:
24    OBBTreeNode();
25    virtual ~OBBTreeNode();
26
27    virtual void spawnBVTree(const int depth, sVec3D *verticesList, const int length);
28
29    BoundingVolume* getBV(int index) const { return (BoundingVolume*)this->bvElement; }
30    inline const int getIndex() { return this->treeIndex; }
31
32    virtual void collideWith(const BVTree &tree);
33
34    virtual void drawBV(int depth) const;
35    virtual void drawBVPolygon(int depth) const;
36    virtual void drawBVBlended(int depth) const;
37
38    void debug();
39
40  private:
41    OBB* createBox();
42    void calculateBoxAttributes(OBB* box, sVec3D* verticesList, int length);
43    void forkBox(OBB* box);
44
45
46  protected:
47    OBB* bvElement;                                 //!< the obb element
48    OBBTreeNode* nodeLeft;                          //!< ref to the left tree node
49    OBBTreeNode* nodeRight;                         //!< ref to the right tree node
50
51
52  private:
53    unsigned int        treeIndex;                  //!< Index number of the BV in the tree
54    sVec3D*             vertices;                   //!< pointer to the vertices data
55    int                 numOfVertices;              //!< number of vertices in vertices data
56    int                 depth;                      //!< the depth of the node in the tree
57
58};
59
60#endif /* _OBB_TREE_NODE_H */
Note: See TracBrowser for help on using the repository browser.