Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Jun 7, 2005, 5:47:07 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: added obb tree node structure to be more modular

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

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/collision_detection/Makefile.am

    r4539 r4541  
    88                     obb.cc \
    99                     obb_tree.cc \
     10                     obb_tree_node.cc \
    1011                     bv_tree.cc \
     12                     bv_tree_node.cc \
    1113                     bounding_volume.cc \
    1214                     bounding_sphere.cc
     
    1921                     obb.h \
    2022                     obb_tree.h \
     23                     obb_tree_node.h \
    2124                     bv_tree.h \
     25                     bv_tree_node.h \
    2226                     bounding_volume.h \
    2327                     bounding_sphere.h
  • orxonox/trunk/src/lib/collision_detection/Makefile.in

    r4539 r4541  
    5555libORXcd_a_LIBADD =
    5656am_libORXcd_a_OBJECTS = cd_engine.$(OBJEXT) collision.$(OBJEXT) \
    57         obb.$(OBJEXT) obb_tree.$(OBJEXT) bv_tree.$(OBJEXT) \
     57        obb.$(OBJEXT) obb_tree.$(OBJEXT) obb_tree_node.$(OBJEXT) \
     58        bv_tree.$(OBJEXT) bv_tree_node.$(OBJEXT) \
    5859        bounding_volume.$(OBJEXT) bounding_sphere.$(OBJEXT)
    5960libORXcd_a_OBJECTS = $(am_libORXcd_a_OBJECTS)
     
    6364@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/bounding_sphere.Po \
    6465@AMDEP_TRUE@    ./$(DEPDIR)/bounding_volume.Po \
    65 @AMDEP_TRUE@    ./$(DEPDIR)/bv_tree.Po ./$(DEPDIR)/cd_engine.Po \
    66 @AMDEP_TRUE@    ./$(DEPDIR)/collision.Po ./$(DEPDIR)/obb.Po \
    67 @AMDEP_TRUE@    ./$(DEPDIR)/obb_tree.Po
     66@AMDEP_TRUE@    ./$(DEPDIR)/bv_tree.Po ./$(DEPDIR)/bv_tree_node.Po \
     67@AMDEP_TRUE@    ./$(DEPDIR)/cd_engine.Po ./$(DEPDIR)/collision.Po \
     68@AMDEP_TRUE@    ./$(DEPDIR)/obb.Po ./$(DEPDIR)/obb_tree.Po \
     69@AMDEP_TRUE@    ./$(DEPDIR)/obb_tree_node.Po
    6870CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
    6971        $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
     
    191193                     obb.cc \
    192194                     obb_tree.cc \
     195                     obb_tree_node.cc \
    193196                     bv_tree.cc \
     197                     bv_tree_node.cc \
    194198                     bounding_volume.cc \
    195199                     bounding_sphere.cc
     
    200204                     obb.h \
    201205                     obb_tree.h \
     206                     obb_tree_node.h \
    202207                     bv_tree.h \
     208                     bv_tree_node.h \
    203209                     bounding_volume.h \
    204210                     bounding_sphere.h
     
    254260@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bounding_volume.Po@am__quote@
    255261@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bv_tree.Po@am__quote@
     262@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bv_tree_node.Po@am__quote@
    256263@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cd_engine.Po@am__quote@
    257264@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/collision.Po@am__quote@
    258265@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/obb.Po@am__quote@
    259266@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/obb_tree.Po@am__quote@
     267@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/obb_tree_node.Po@am__quote@
    260268
    261269.cc.o:
  • orxonox/trunk/src/lib/collision_detection/bounding_volume.h

    r4533 r4541  
    1212class sVect3D;
    1313class Vector;
     14template<class T> class tList;
     15
    1416
    1517//! An abstract class representing a bounding volume
     
    2022  virtual ~BoundingVolume();
    2123
     24  virtual void createBV() = NULL;
     25
    2226  inline const Vector* getCenter() const { return this->center; }
    23   inline const int getIndex() { return this->treeIndex; }
    2427
    25   virtual sVect3D* getVertices() const = NULL;
     28  virtual tList<sVect3D>* getVertices() const = NULL;
    2629  virtual void mergeWith(const BoundingVolume &bv) = NULL;
    2730
     
    3437  Vector*             center;                     //!< Center point of box
    3538
    36   unsigned int        treeIndex;                  //!< Index number of the BV in the tree
     39  tList<sVect3D>*     verticesBuffer;             //!< if CD_STORE_VERTICES enabled, this is the place, where the vert. will be sotred
    3740};
    3841
  • orxonox/trunk/src/lib/collision_detection/cd_engine.h

    r4526 r4541  
    2222    CD_DEBUG_DRAW_BLENDED = 1<<2,
    2323    CD_DEBUG_DRAW_HIT_BV = 1<<3,
    24     CD_DEBUG_VERBOSE = 1<<4
     24    CD_DEBUG_VERBOSE = 1<<4,
     25
     26    CD_STORE_VERTICES = 1<<5
    2527  };
    2628
  • orxonox/trunk/src/lib/collision_detection/obb.cc

    r4531 r4541  
    1717
    1818#include "obb.h"
     19#include "list.h"
    1920
    2021using namespace std;
     
    4041
    4142
    42 sVect3D* OBB::getVertices() const
     43void OBB::createBV() const
    4344{}
    4445
  • orxonox/trunk/src/lib/collision_detection/obb.h

    r4531 r4541  
    1111#include "bounding_volume.h"
    1212
     13template<class T> class tList;
    1314
    1415//! A class representing an extended bounding volume tree: an obb tree
     
    1920  virtual ~OBB();
    2021
     22  virtual void createBV() const;
     23
    2124  inline const Vector* getAxis () const { return this->axis; }
    2225  inline const sVect3D* getHalfLength() const { return this->halfLength; }
    2326
    24   virtual sVect3D* getVertices() const;
     27  virtual tList<sVect3D>* getVertices() const { return this->verticesBuffer; }
    2528  virtual void mergeWith(const BoundingVolume &bv);
    2629
  • orxonox/trunk/src/lib/collision_detection/obb_tree.cc

    r4533 r4541  
    4444void OBBTree::spawnBVTree(int depth)
    4545{
    46   OBB obb();
     46  float area[this->numberOfVertices];  //!< surface area of the i'th triangle of the convex hull
     47  float areaTotal; //!< surface area of the entire convex hull
     48  float centroid[this->numberOfVertices]; //!< centroid of the i'th convex hull
     49 
     50
     51  //OBB obb();
    4752  float muX, muY, muZ;
    4853  for(int i = 0; i < this->numberOfVertices; ++i)
Note: See TracChangeset for help on using the changeset viewer.