Back to index

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

btEmptyShape is a collision shape without actual collision detection. It can be replaced by another shape during runtime More...

#include <btEmptyShape.h>

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

List of all members.

Public Member Functions

 btEmptyShape ()
virtual ~btEmptyShape ()
void getAabb (const btTransform &t, btVector3 &aabbMin, btVector3 &aabbMax) const
 getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
virtual void setLocalScaling (const btVector3 &scaling)
virtual const btVector3getLocalScaling () const
virtual void calculateLocalInertia (btScalar mass, btVector3 &inertia) const
virtual int getShapeType () const
virtual const char * getName () const
virtual void processAllTriangles (btTriangleCallback *callback, const btVector3 &aabbMin, const btVector3 &aabbMax) const =0
virtual btScalar getMargin () const
virtual void setMargin (btScalar collisionMargin)
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)
void setUserPointer (void *userPtr)
 optional user data pointer
void * getUserPointer () const

Protected Attributes

btVector3 m_localScaling
btScalar m_collisionMargin

Detailed Description

btEmptyShape is a collision shape without actual collision detection. It can be replaced by another shape during runtime

Definition at line 31 of file btEmptyShape.h.


Constructor & Destructor Documentation

Definition at line 22 of file btEmptyShape.cpp.

{
}

Definition at line 27 of file btEmptyShape.cpp.

{
}

Member Function Documentation

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

Implements btCollisionShape.

Definition at line 43 of file btEmptyShape.cpp.

{
       btAssert(0);
}
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:

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

getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version

Implements btCollisionShape.

Definition at line 33 of file btEmptyShape.cpp.

{
       btVector3 margin(getMargin(),getMargin(),getMargin());

       aabbMin = t.getOrigin() - margin;

       aabbMax = t.getOrigin() + margin;

}

Here is the call 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& btEmptyShape::getLocalScaling ( ) const [inline, virtual]

Implements btCollisionShape.

Definition at line 47 of file btEmptyShape.h.

       {
              return m_localScaling;
       }
virtual btScalar btConcaveShape::getMargin ( ) const [inline, virtual, inherited]

Implements btCollisionShape.

Definition at line 38 of file btConcaveShape.h.

                                          {
              return m_collisionMargin;
       }

Here is the caller graph for this function:

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

Implements btCollisionShape.

Definition at line 57 of file btEmptyShape.h.

       {
              return "Empty";
       }
virtual int btEmptyShape::getShapeType ( ) const [inline, virtual]

Implements btCollisionShape.

Definition at line 54 of file btEmptyShape.h.

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

Implemented in btHeightfieldTerrainShape, btTriangleMeshShape, and btStaticPlaneShape.

Here is the caller graph for this function:

virtual void btEmptyShape::setLocalScaling ( const btVector3 scaling) [inline, virtual]

Implements btCollisionShape.

Definition at line 43 of file btEmptyShape.h.

       {
              m_localScaling = scaling;
       }
virtual void btConcaveShape::setMargin ( btScalar  collisionMargin) [inline, virtual, inherited]

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.

Definition at line 64 of file btEmptyShape.h.


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