Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4543 in orxonox.OLD for orxonox/trunk/src/lib/collision_detection


Ignore:
Timestamp:
Jun 7, 2005, 6:20:27 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: spawn tree function implementation, vertices list issues

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

Legend:

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

    r4542 r4543  
    2323  virtual ~BVTreeNode();
    2424
    25   virtual void spawnBVTree(const int depth, tList<sVec3D> *verticesList) = NULL;
     25  virtual void spawnBVTree(const int depth, sVec3D *verticesList, const int length ) = NULL;
    2626
    2727  virtual BoundingVolume* getBV(int index) const = NULL;
  • orxonox/trunk/src/lib/collision_detection/obb_tree_node.cc

    r4542 r4543  
    1919#include "list.h"
    2020#include "obb.h"
     21
     22#include <math.h>
    2123
    2224using namespace std;
     
    4951   \param verticesList: the list of vertices of the object - each vertices triple is interpreted as a triangle
    5052*/
    51 void OBBTreeNode::spawnBVTree(const int depth, tList<sVec3D> *verticesList)
     53void OBBTreeNode::spawnBVTree(const int depth, const sVec3D *verticesList, const int length)
    5254{
    53   float     area[verticesList->getSize()];           //!< surface area of the i'th triangle of the convex hull
    54   float     areaTotal;                               //!< surface area of the entire convex hull
    55   float     centroid[verticesList->getSize()];       //!< centroid of the i'th convex hull 
     55  float     facelet[length];                         //!< surface area of the i'th triangle of the convex hull
     56  float     face;                                    //!< surface area of the entire convex hull
     57  float     centroid[length];                        //!< centroid of the i'th convex hull 
    5658  OBB*      obb = new OBB();                         //!< the new obb to add
    5759
    58   /* fist compute all the convex hull particles */
    59   for(int i = 0; i < verticesList->getSize(); ++i)
     60  /* fist compute all the convex hull facelets */
     61  for(int i = 0; i < length; ++i)
    6062    {
    61      
     63      facelet[i] = 0.5f * fabs(5.0);
    6264    }
    6365}
  • orxonox/trunk/src/lib/collision_detection/obb_tree_node.h

    r4542 r4543  
    2222  virtual ~OBBTreeNode();
    2323
    24   virtual void spawnBVTree(const int depth, tList<sVec3D> *verticesList);
     24  virtual void spawnBVTree(const int depth, const sVec3D *verticesList, const int length);
    2525
    2626  BoundingVolume* getBV(int index) const { return this->bvElement; }
Note: See TracChangeset for help on using the changeset viewer.