Public Member Functions | Private Attributes

btConvexHullShape Class Reference

The btConvexHullShape implements an implicit convex hull of an array of vertices. More...

#include <btConvexHullShape.h>

Inheritance diagram for btConvexHullShape:
Inheritance graph
[legend]
Collaboration diagram for btConvexHullShape:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 BT_DECLARE_ALIGNED_ALLOCATOR ()
 btConvexHullShape (const btScalar *points=0, int numPoints=0, int stride=sizeof(btVector3))
 this constructor optionally takes in a pointer to points.
void addPoint (const btVector3 &point)
btVector3getUnscaledPoints ()
const btVector3getUnscaledPoints () const
const btVector3getPoints () const
 getPoints is obsolete, please use getUnscaledPoints
btVector3 getScaledPoint (int i) const
int getNumPoints () const
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 void project (const btTransform &trans, const btVector3 &dir, btScalar &minProj, btScalar &maxProj, btVector3 &witnesPtMin, btVector3 &witnesPtMax) const
virtual const char * getName () const
virtual int getNumVertices () const
virtual int getNumEdges () const
virtual void getEdge (int i, btVector3 &pa, btVector3 &pb) const
virtual void getVertex (int i, btVector3 &vtx) const
virtual int getNumPlanes () const
virtual void getPlane (btVector3 &planeNormal, btVector3 &planeSupport, int i) const
virtual bool isInside (const btVector3 &pt, btScalar tolerance) const
virtual void setLocalScaling (const btVector3 &scaling)
 in case we receive negative scaling
virtual int calculateSerializeBufferSize () const
virtual const char * serialize (void *dataBuffer, btSerializer *serializer) const
 fills the dataBuffer and returns the struct name (and 0 on failure)

Private Attributes

btAlignedObjectArray< btVector3m_unscaledPoints

Detailed Description

The btConvexHullShape implements an implicit convex hull of an array of vertices.

Bullet provides a general and fast collision detector for convex shapes based on GJK and EPA using localGetSupportingVertex.

Definition at line 26 of file btConvexHullShape.h.


Constructor & Destructor Documentation

btConvexHullShape::btConvexHullShape ( const btScalar points = 0,
int  numPoints = 0,
int  stride = sizeof(btVector3) 
)

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 22 of file btConvexHullShape.cpp.


Member Function Documentation

void btConvexHullShape::addPoint ( const btVector3 point  ) 

Definition at line 48 of file btConvexHullShape.cpp.

void btConvexHullShape::batchedUnitVectorGetSupportingVertexWithoutMargin ( const btVector3 vectors,
btVector3 supportVerticesOut,
int  numVectors 
) const [virtual]

Reimplemented from btPolyhedralConvexShape.

Definition at line 71 of file btConvexHullShape.cpp.

btConvexHullShape::BT_DECLARE_ALIGNED_ALLOCATOR (  ) 

Reimplemented from btPolyhedralConvexShape.

int btConvexHullShape::calculateSerializeBufferSize (  )  const [inline, virtual]

Reimplemented from btConvexInternalShape.

Definition at line 115 of file btConvexHullShape.h.

void btConvexHullShape::getEdge ( int  i,
btVector3 pa,
btVector3 pb 
) const [virtual]

Implements btPolyhedralConvexShape.

Definition at line 138 of file btConvexHullShape.cpp.

virtual const char* btConvexHullShape::getName (  )  const [inline, virtual]

Implements btCollisionShape.

Definition at line 80 of file btConvexHullShape.h.

int btConvexHullShape::getNumEdges (  )  const [virtual]

Implements btPolyhedralConvexShape.

Definition at line 133 of file btConvexHullShape.cpp.

int btConvexHullShape::getNumPlanes (  )  const [virtual]

Implements btPolyhedralConvexShape.

Definition at line 152 of file btConvexHullShape.cpp.

int btConvexHullShape::getNumPoints (  )  const [inline]

Definition at line 66 of file btConvexHullShape.h.

int btConvexHullShape::getNumVertices (  )  const [virtual]

Implements btPolyhedralConvexShape.

Definition at line 128 of file btConvexHullShape.cpp.

void btConvexHullShape::getPlane ( btVector3 planeNormal,
btVector3 planeSupport,
int  i 
) const [virtual]

Implements btPolyhedralConvexShape.

Definition at line 157 of file btConvexHullShape.cpp.

const btVector3* btConvexHullShape::getPoints (  )  const [inline]

getPoints is obsolete, please use getUnscaledPoints

Definition at line 53 of file btConvexHullShape.h.

btVector3 btConvexHullShape::getScaledPoint ( int  i  )  const [inline]

Definition at line 61 of file btConvexHullShape.h.

const btVector3* btConvexHullShape::getUnscaledPoints (  )  const [inline]

Definition at line 47 of file btConvexHullShape.h.

btVector3* btConvexHullShape::getUnscaledPoints (  )  [inline]

Definition at line 42 of file btConvexHullShape.h.

void btConvexHullShape::getVertex ( int  i,
btVector3 vtx 
) const [virtual]

Implements btPolyhedralConvexShape.

Definition at line 147 of file btConvexHullShape.cpp.

bool btConvexHullShape::isInside ( const btVector3 pt,
btScalar  tolerance 
) const [virtual]

Implements btPolyhedralConvexShape.

Definition at line 164 of file btConvexHullShape.cpp.

btVector3 btConvexHullShape::localGetSupportingVertex ( const btVector3 vec  )  const [virtual]

Reimplemented from btConvexInternalShape.

Definition at line 101 of file btConvexHullShape.cpp.

btVector3 btConvexHullShape::localGetSupportingVertexWithoutMargin ( const btVector3 vec  )  const [virtual]

Reimplemented from btPolyhedralConvexShape.

Definition at line 55 of file btConvexHullShape.cpp.

void btConvexHullShape::project ( const btTransform trans,
const btVector3 dir,
btScalar minProj,
btScalar maxProj,
btVector3 witnesPtMin,
btVector3 witnesPtMax 
) const [virtual]

Definition at line 204 of file btConvexHullShape.cpp.

const char * btConvexHullShape::serialize ( void *  dataBuffer,
btSerializer serializer 
) const [virtual]

fills the dataBuffer and returns the struct name (and 0 on failure)

Reimplemented from btConvexInternalShape.

Definition at line 171 of file btConvexHullShape.cpp.

void btConvexHullShape::setLocalScaling ( const btVector3 scaling  )  [virtual]

in case we receive negative scaling

Reimplemented from btPolyhedralConvexAabbCachingShape.

Definition at line 42 of file btConvexHullShape.cpp.


Member Data Documentation

Definition at line 28 of file btConvexHullShape.h.


The documentation for this class was generated from the following files: