Back to index

supertuxkart  0.5+dfsg1
Functions
btConvexHullShape.h File Reference
#include "btPolyhedralConvexShape.h"
#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
#include "LinearMath/btAlignedObjectArray.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 ATTRIBUTE_ALIGNED16 (class) btConvexHullShape
 ConvexHullShape implements an implicit (getSupportingVertex) Convex Hull of a Point Cloud (vertices) No connectivity is needed. localGetSupportingVertex iterates linearly though all vertices. on modern hardware, due to cache coherency this isn't that bad. Complex algorithms tend to trash the cash. (memory is much slower then the cpu)

Function Documentation

ATTRIBUTE_ALIGNED16 ( class  )

ConvexHullShape implements an implicit (getSupportingVertex) Convex Hull of a Point Cloud (vertices) No connectivity is needed. localGetSupportingVertex iterates linearly though all vertices. on modern hardware, due to cache coherency this isn't that bad. Complex algorithms tend to trash the cash. (memory is much slower then the cpu)

this constructor optionally takes in a pointer to points. Each point is assumed to be 3 consecutive btScalar (x,y,z), the striding defines the number of bytes between each point, in memory. It is easier to not pass any points in the constructor, and just add one point at a time, using addPoint. btConvexHullShape make an internal copy of the points.

Definition at line 27 of file btConvexHullShape.h.

                                             : public btPolyhedralConvexShape
{
       btAlignedObjectArray<btPoint3>     m_points;

public:
       BT_DECLARE_ALIGNED_ALLOCATOR();

       
       btConvexHullShape(const btScalar* points=0,int numPoints=0, int stride=sizeof(btPoint3));

       void addPoint(const btPoint3& point);

       btPoint3* getPoints()
       {
              return &m_points[0];
       }

       const btPoint3* getPoints() const
       {
              return &m_points[0];
       }

       int getNumPoints() const 
       {
              return m_points.size();
       }

       virtual btVector3    localGetSupportingVertex(const btVector3& vec)const;
       virtual btVector3    localGetSupportingVertexWithoutMargin(const btVector3& vec)const;
       virtual void  batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const;
       

       virtual int   getShapeType()const { return CONVEX_HULL_SHAPE_PROXYTYPE; }

       //debugging
       virtual const char*  getName()const {return "Convex";}

       
       virtual int   getNumVertices() const;
       virtual int getNumEdges() const;
       virtual void getEdge(int i,btPoint3& pa,btPoint3& pb) const;
       virtual void getVertex(int i,btPoint3& vtx) const;
       virtual int   getNumPlanes() const;
       virtual void getPlane(btVector3& planeNormal,btPoint3& planeSupport,int i ) const;
       virtual       bool isInside(const btPoint3& pt,btScalar tolerance) const;



};

Here is the call graph for this function: