Back to index

supertuxkart  0.5+dfsg1
Public Member Functions | Protected Attributes
btConcaveShape Class Reference

Concave shape proves an interface concave shapes that can produce triangles that overlapping a given AABB. Static triangle mesh, infinite plane, height field/landscapes are example that implement this interface. More...

#include <btConcaveShape.h>

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

List of all members.

Public Member Functions

 btConcaveShape ()
virtual ~btConcaveShape ()
virtual void processAllTriangles (btTriangleCallback *callback, const btVector3 &aabbMin, const btVector3 &aabbMax) const =0
virtual btScalar getMargin () const
virtual void setMargin (btScalar collisionMargin)
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
void setUserPointer (void *userPtr)
 optional user data pointer
void * getUserPointer () const

Protected Attributes

btScalar m_collisionMargin

Detailed Description

Concave shape proves an interface concave shapes that can produce triangles that overlapping a given AABB. Static triangle mesh, infinite plane, height field/landscapes are example that implement this interface.

Definition at line 26 of file btConcaveShape.h.


Constructor & Destructor Documentation

Definition at line 20 of file btConcaveShape.cpp.

Definition at line 25 of file btConcaveShape.cpp.

{

}

Member Function Documentation

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

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 [inherited]

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, inherited]

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:

btScalar btCollisionShape::getAngularMotionDisc ( ) const [virtual, inherited]

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, inherited]

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, inherited]
virtual btScalar btConcaveShape::getMargin ( ) const [inline, virtual]

Implements btCollisionShape.

Definition at line 38 of file btConcaveShape.h.

                                          {
              return m_collisionMargin;
       }

Here is the caller graph for this function:

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

Implemented in btHeightfieldTerrainShape, btTriangleMeshShape, btStaticPlaneShape, and btEmptyShape.

Here is the caller graph for this function:

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

Implemented in btHeightfieldTerrainShape, btEmptyShape, and btStaticPlaneShape.

Here is the caller graph for this function:

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

Definition at line 101 of file btCollisionShape.h.

       {
              return m_userPointer;
       }

Here is the caller graph for this function:

SIMD_FORCE_INLINE bool btCollisionShape::isCompound ( ) const [inline, inherited]

Definition at line 68 of file btCollisionShape.h.

Here is the call graph for this function:

Here is the caller graph for this function:

SIMD_FORCE_INLINE bool btCollisionShape::isConcave ( ) const [inline, inherited]

Definition at line 64 of file btCollisionShape.h.

Here is the call graph for this function:

Here is the caller graph for this function:

SIMD_FORCE_INLINE bool btCollisionShape::isConvex ( ) const [inline, inherited]

Definition at line 60 of file btCollisionShape.h.

Here is the call graph for this function:

Here is the caller graph for this function:

SIMD_FORCE_INLINE bool btCollisionShape::isInfinite ( ) const [inline, inherited]

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:

SIMD_FORCE_INLINE bool btCollisionShape::isPolyhedral ( ) const [inline, inherited]

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 btConcaveShape::processAllTriangles ( btTriangleCallback callback,
const btVector3 aabbMin,
const btVector3 aabbMax 
) const [pure virtual]

Implemented in btHeightfieldTerrainShape, btTriangleMeshShape, and btStaticPlaneShape.

Here is the caller graph for this function:

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

Implemented in btHeightfieldTerrainShape, btTriangleMeshShape, btStaticPlaneShape, and btEmptyShape.

Here is the caller graph for this function:

virtual void btConcaveShape::setMargin ( btScalar  collisionMargin) [inline, virtual]

Implements btCollisionShape.

Definition at line 41 of file btConcaveShape.h.

       {
              m_collisionMargin = collisionMargin;
       }
void btCollisionShape::setUserPointer ( void *  userPtr) [inline, inherited]

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 btConcaveShape.h.


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