Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Jun 13, 2005, 9:17:55 AM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: now bounding box gets displayed very well

Location:
orxonox/trunk/src/lib/collision_detection
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/collision_detection/bounding_volume.h

    r4588 r4616  
    33    \brief Definition of a bounding volume for collision detection algorithms
    44
    5 */
     5 */
    66
    77#ifndef _BOUNDING_VOLUME_H
     
    1818class BoundingVolume : public BaseObject {
    1919
    20  public:
    21   BoundingVolume();
    22   virtual ~BoundingVolume();
     20  public:
     21    BoundingVolume();
     22    virtual ~BoundingVolume();
    2323
    24   inline const Vector* getCenter() const { return this->center; }
     24    inline const Vector* getCenter() const { return this->center; }
    2525
    26   sVec3D* getVertices() const { return this->vertices; }
    27   virtual void mergeWith(const BoundingVolume &bv) = NULL;
     26    sVec3D* getVertices() const { return this->vertices; }
     27    virtual void mergeWith(const BoundingVolume &bv) = NULL;
    2828
    29   virtual void drawBV(int currentDepth, const int depth) const = NULL;
    30   virtual void drawBVPolygon(int currentDepth, const int depth) const = NULL;
    31   virtual void drawBVBlended(int currentDepth, const int depth) const = NULL;
     29    virtual void drawBV(int currentDepth, const int depth) const = NULL;
     30    virtual void drawBVPolygon(int currentDepth, const int depth) const = NULL;
     31    virtual void drawBVBlended(int currentDepth, const int depth) const = NULL;
    3232
    3333
    34  public:
    35   Vector*             center;                     //!< Center point of box
     34  public:
     35    Vector*             center;                     //!< Center point of box
    3636
    37   sVec3D*             vertices;                   //!< if CD_STORE_VERTICES enabled, this is the place, where the vert. will be sotred
    38   int                 numOfVertices;              //!< number of vertices in the vertices buffer
     37    sVec3D*             vertices;                   //!< if CD_STORE_VERTICES enabled, this is the place, where the vert. will be sotred
     38    int                 numOfVertices;              //!< number of vertices in the vertices buffer
    3939};
    4040
  • orxonox/trunk/src/lib/collision_detection/obb_tree.cc

    r4615 r4616  
    2121#include "debug.h"
    2222#include "compiler.h"
     23#include "material.h"
    2324
    2425using namespace std;
    2526
     27
     28Material* OBBTree::material = NULL;
    2629
    2730/**
     
    3033OBBTree::OBBTree ()
    3134{
    32    this->setClassID(CL_OBB_TREE, "OBBTree");
    33 
     35  this->setClassID(CL_OBB_TREE, "OBBTree");
     36  material = new Material("Tree");
     37  material->setIllum(3);
     38  material->setAmbient(1.0, 1.0, 1.0);
    3439}
    3540
  • orxonox/trunk/src/lib/collision_detection/obb_tree.h

    r4551 r4616  
    1 /*! 
     1/*!
    22    \file obb_tree.h
    33    \brief Definition of an obb tree (object oriented Bounding Box)
     
    1010#include "bv_tree.h"
    1111#include "abstract_model.h"
     12#include "material.h"
    1213
     14class Material;
    1315class OBBTreeNode;
    1416
     
    1618class OBBTree : public BVTree {
    1719
    18  public:
    19   OBBTree();
    20   virtual ~OBBTree();
     20  public:
     21    OBBTree();
     22    virtual ~OBBTree();
    2123
    22   virtual void spawnBVTree(int depth, sVec3D *verticesList, const int length);
    23   virtual void flushTree();
     24    virtual void spawnBVTree(int depth, sVec3D *verticesList, const int length);
     25    virtual void flushTree();
    2426
    25   void collideWith(const OBBTree &tree);
     27    void collideWith(const OBBTree &tree);
    2628
    27   virtual void drawBV(int currentDepth, const int depth) const;
    28   virtual void drawBVPolygon(int currentDepth, const int depth) const;
    29   virtual void drawBVBlended(int currentDepth, const int depth) const;
     29    virtual void drawBV(int currentDepth, const int depth) const;
     30    virtual void drawBVPolygon(int currentDepth, const int depth) const;
     31    virtual void drawBVBlended(int currentDepth, const int depth) const;
    3032
    31   void debug();
     33    void debug();
    3234
    33  private:
    34   OBBTreeNode*         rootNode;                        //!< reference to the root node of the tree
     35  public:
     36    static Material* material;
     37
     38
     39  private:
     40    OBBTreeNode*         rootNode;                        //!< reference to the root node of the tree
    3541
    3642};
  • orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc

    r4615 r4616  
    1919#include "list.h"
    2020#include "obb.h"
     21#include "obb_tree.h"
    2122#include "vector.h"
    2223#include "abstract_model.h"
     
    402403void OBBTreeNode::drawBVPolygon(int currentDepth, const int depth) const
    403404{
     405
     406  OBBTree::material->select();
    404407
    405408  /* draw world axes */
Note: See TracChangeset for help on using the changeset viewer.