Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

orxonox/trunk: now the obb tree is build as it should

File size: 1.7 KB
RevLine 
[4614]1/*!
[4541]2    \file bv_tree.h
3    \brief Definition of a bounding volume tree
4
[4614]5 */
[4541]6
7#ifndef _OBB_TREE_NODE_H
8#define _OBB_TREE_NODE_H
9
10#include "bv_tree_node.h"
11
[4550]12
13
[4541]14// FORWARD DEFINITION
15class BoundingVolume;
[4557]16class OBB;
[4550]17//struct sVec3D;
[4541]18
19//! A class that represents a bounding volume tree
20class OBBTreeNode : public BVTreeNode {
21
22
[4614]23  public:
24    OBBTreeNode();
25    virtual ~OBBTreeNode();
[4541]26
[4614]27    virtual void spawnBVTree(const int depth, sVec3D *verticesList, const int length);
[4541]28
[4614]29    BoundingVolume* getBV(int index) const { return (BoundingVolume*)this->bvElement; }
30    inline const int getIndex() { return this->treeIndex; }
[4541]31
[4614]32    virtual void collideWith(const BVTree &tree);
[4541]33
[4614]34    virtual void drawBV(int currentDepth, const int depth) const;
35    virtual void drawBVPolygon(int currentDepth, const int depth) const;
36    virtual void drawBVBlended(int currentDepth, const int depth) const;
[4541]37
[4614]38    void debug();
[4568]39
[4614]40  private:
41    OBB* createBox();
42    void calculateBoxAttributes(OBB* box, sVec3D* verticesList, int length);
43    void forkBox(OBB* box);
[4541]44
45
[4614]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
[4541]50
51
[4614]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
[4541]58};
59
60#endif /* _OBB_TREE_NODE_H */
Note: See TracBrowser for help on using the repository browser.