Back to index

supertuxkart  0.5+dfsg1
Public Member Functions | Private Attributes
btCollisionShape Class Reference

btCollisionShape provides interface for collision shapes that can be shared among btCollisionObjects. More...

#include <btCollisionShape.h>

Inheritance diagram for btCollisionShape:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 btCollisionShape ()
virtual ~btCollisionShape ()
virtual void getAabb (const btTransform &t, btVector3 &aabbMin, btVector3 &aabbMax) const =0
 getAabb returns the axis aligned bounding box in the coordinate frame of the given transform t.
virtual void getBoundingSphere (btVector3 &center, btScalar &radius) const
virtual btScalar getAngularMotionDisc () const
 getAngularMotionDisc returns the maximus radius needed for Conservative Advancement to handle time-of-impact with rotations.
void calculateTemporalAabb (const btTransform &curTrans, const btVector3 &linvel, const btVector3 &angvel, btScalar timeStep, btVector3 &temporalAabbMin, btVector3 &temporalAabbMax) const
 calculateTemporalAabb calculates the enclosing aabb for the moving object over interval [0..timeStep) result is conservative
SIMD_FORCE_INLINE bool isPolyhedral () const
SIMD_FORCE_INLINE bool isConvex () const
SIMD_FORCE_INLINE bool isConcave () const
SIMD_FORCE_INLINE bool isCompound () const
SIMD_FORCE_INLINE bool isInfinite () const
 isInfinite is used to catch simulation error (aabb check)
virtual int getShapeType () const =0
virtual void setLocalScaling (const btVector3 &scaling)=0
virtual const btVector3getLocalScaling () const =0
virtual void calculateLocalInertia (btScalar mass, btVector3 &inertia) const =0
virtual const char * getName () const =0
virtual void setMargin (btScalar margin)=0
virtual btScalar getMargin () const =0
void setUserPointer (void *userPtr)
 optional user data pointer
void * getUserPointer () const

Private Attributes

void * m_userPointer

Detailed Description

btCollisionShape provides interface for collision shapes that can be shared among btCollisionObjects.

Definition at line 26 of file btCollisionShape.h.


Constructor & Destructor Documentation

Definition at line 33 of file btCollisionShape.h.

                          : m_userPointer(0)
       {
       }
virtual btCollisionShape::~btCollisionShape ( ) [inline, virtual]

Definition at line 36 of file btCollisionShape.h.

       {
       }

Member Function Documentation

virtual void btCollisionShape::calculateLocalInertia ( btScalar  mass,
btVector3 inertia 
) const [pure virtual]

Implemented in btHeightfieldTerrainShape, btTriangleMeshShape, btEmptyShape, and btStaticPlaneShape.

Here is the caller graph for this function:

void btCollisionShape::calculateTemporalAabb ( const btTransform curTrans,
const btVector3 linvel,
const btVector3 angvel,
btScalar  timeStep,
btVector3 temporalAabbMin,
btVector3 temporalAabbMax 
) const

calculateTemporalAabb calculates the enclosing aabb for the moving object over interval [0..timeStep) result is conservative

Definition at line 49 of file btCollisionShape.cpp.

{
       //start with static aabb
       getAabb(curTrans,temporalAabbMin,temporalAabbMax);

       btScalar temporalAabbMaxx = temporalAabbMax.getX();
       btScalar temporalAabbMaxy = temporalAabbMax.getY();
       btScalar temporalAabbMaxz = temporalAabbMax.getZ();
       btScalar temporalAabbMinx = temporalAabbMin.getX();
       btScalar temporalAabbMiny = temporalAabbMin.getY();
       btScalar temporalAabbMinz = temporalAabbMin.getZ();

       // add linear motion
       btVector3 linMotion = linvel*timeStep;
       //todo: simd would have a vector max/min operation, instead of per-element access
       if (linMotion.x() > btScalar(0.))
              temporalAabbMaxx += linMotion.x(); 
       else
              temporalAabbMinx += linMotion.x();
       if (linMotion.y() > btScalar(0.))
              temporalAabbMaxy += linMotion.y(); 
       else
              temporalAabbMiny += linMotion.y();
       if (linMotion.z() > btScalar(0.))
              temporalAabbMaxz += linMotion.z(); 
       else
              temporalAabbMinz += linMotion.z();

       //add conservative angular motion
       btScalar angularMotion = angvel.length() * getAngularMotionDisc() * timeStep;
       btVector3 angularMotion3d(angularMotion,angularMotion,angularMotion);
       temporalAabbMin = btVector3(temporalAabbMinx,temporalAabbMiny,temporalAabbMinz);
       temporalAabbMax = btVector3(temporalAabbMaxx,temporalAabbMaxy,temporalAabbMaxz);

       temporalAabbMin -= angularMotion3d;
       temporalAabbMax += angularMotion3d;
}

Here is the call graph for this function:

virtual void btCollisionShape::getAabb ( const btTransform t,
btVector3 aabbMin,
btVector3 aabbMax 
) const [pure virtual]

getAabb returns the axis aligned bounding box in the coordinate frame of the given transform t.

Implemented in btHeightfieldTerrainShape, btTriangleMeshShape, btStaticPlaneShape, and btEmptyShape.

Here is the caller graph for this function:

getAngularMotionDisc returns the maximus radius needed for Conservative Advancement to handle time-of-impact with rotations.

Definition at line 40 of file btCollisionShape.cpp.

{
       btVector3     center;
       btScalar disc;
       getBoundingSphere(center,disc);
       disc += (center).length();
       return disc;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void btCollisionShape::getBoundingSphere ( btVector3 center,
btScalar radius 
) const [virtual]

Definition at line 28 of file btCollisionShape.cpp.

{
       btTransform tr;
       tr.setIdentity();
       btVector3 aabbMin,aabbMax;

       getAabb(tr,aabbMin,aabbMax);

       radius = (aabbMax-aabbMin).length()*btScalar(0.5);
       center = (aabbMin+aabbMax)*btScalar(0.5);
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual const btVector3& btCollisionShape::getLocalScaling ( ) const [pure virtual]
virtual btScalar btCollisionShape::getMargin ( ) const [pure virtual]

Implemented in btConcaveShape.

Here is the caller graph for this function:

virtual const char* btCollisionShape::getName ( ) const [pure virtual]

Implemented in btHeightfieldTerrainShape, btTriangleMeshShape, btStaticPlaneShape, and btEmptyShape.

Here is the caller graph for this function:

virtual int btCollisionShape::getShapeType ( ) const [pure virtual]

Implemented in btHeightfieldTerrainShape, btEmptyShape, and btStaticPlaneShape.

Here is the caller graph for this function:

void* btCollisionShape::getUserPointer ( ) const [inline]

Definition at line 101 of file btCollisionShape.h.

       {
              return m_userPointer;
       }

Here is the caller graph for this function:

Definition at line 68 of file btCollisionShape.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 64 of file btCollisionShape.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 60 of file btCollisionShape.h.

Here is the call graph for this function:

Here is the caller graph for this function:

isInfinite is used to catch simulation error (aabb check)

Definition at line 74 of file btCollisionShape.h.

Here is the call graph for this function:

Definition at line 55 of file btCollisionShape.h.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void btCollisionShape::setLocalScaling ( const btVector3 scaling) [pure virtual]

Implemented in btHeightfieldTerrainShape, btTriangleMeshShape, btStaticPlaneShape, and btEmptyShape.

Here is the caller graph for this function:

virtual void btCollisionShape::setMargin ( btScalar  margin) [pure virtual]

Implemented in btConcaveShape.

void btCollisionShape::setUserPointer ( void *  userPtr) [inline]

optional user data pointer

Definition at line 96 of file btCollisionShape.h.

       {
              m_userPointer = userPtr;
       }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 29 of file btCollisionShape.h.


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