Back to index

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

btMinkowskiSumShape represents implicit (getSupportingVertex) based minkowski sum of two convex implicit shapes. More...

#include <btMinkowskiSumShape.h>

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

List of all members.

Public Member Functions

 btMinkowskiSumShape (const btConvexShape *shapeA, const btConvexShape *shapeB)
virtual btVector3 localGetSupportingVertexWithoutMargin (const btVector3 &vec) const
virtual void batchedUnitVectorGetSupportingVertexWithoutMargin (const btVector3 *vectors, btVector3 *supportVerticesOut, int numVectors) const
virtual void calculateLocalInertia (btScalar mass, btVector3 &inertia) const
void setTransformA (const btTransform &transA)
void setTransformB (const btTransform &transB)
const btTransformgetTransformA () const
const btTransformGetTransformB () const
virtual int getShapeType () const
virtual btScalar getMargin () const
const btConvexShape * getShapeA () const
const btConvexShape * getShapeB () const
virtual const char * getName () const
virtual btVector3 localGetSupportingVertex (const btVector3 &vec) const
const btVector3getImplicitShapeDimensions () const
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 getAabbSlow (const btTransform &t, btVector3 &aabbMin, btVector3 &aabbMax) const
virtual void setLocalScaling (const btVector3 &scaling)
virtual const btVector3getLocalScaling () const
const btVector3getLocalScalingNV () const
virtual void setMargin (btScalar margin)
btScalar getMarginNV () const
virtual int getNumPreferredPenetrationDirections () const
virtual void getPreferredPenetrationDirection (int index, btVector3 &penetrationVector) const

Protected Attributes

btVector3 m_localScaling
btVector3 m_implicitShapeDimensions
btScalar m_collisionMargin
btScalar m_padding

Private Attributes

btTransform m_transA
btTransform m_transB
const btConvexShape * m_shapeA
const btConvexShape * m_shapeB

Detailed Description

btMinkowskiSumShape represents implicit (getSupportingVertex) based minkowski sum of two convex implicit shapes.

Definition at line 23 of file btMinkowskiSumShape.h.


Constructor & Destructor Documentation

btMinkowskiSumShape::btMinkowskiSumShape ( const btConvexShape *  shapeA,
const btConvexShape *  shapeB 
)

Definition at line 19 of file btMinkowskiSumShape.cpp.

Here is the call graph for this function:


Member Function Documentation

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

Implements btConvexInternalShape.

Definition at line 34 of file btMinkowskiSumShape.cpp.

{
       //todo: could make recursive use of batching. probably this shape is not used frequently.
       for (int i=0;i<numVectors;i++)
       {
              supportVerticesOut[i] = localGetSupportingVertexWithoutMargin(vectors[i]);
       }

}

Here is the call graph for this function:

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

Definition at line 52 of file btMinkowskiSumShape.cpp.

{
       (void)mass;
       btAssert(0);
       inertia.setValue(0,0,0);
}

Here is the call graph for this function:

void btConvexInternalShape::getAabb ( const btTransform t,
btVector3 aabbMin,
btVector3 aabbMax 
) const [inline, inherited]

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

Reimplemented in btBoxShape, btPolyhedralConvexShape, btTriangleShape, btCapsuleShape, and btCylinderShape.

Definition at line 46 of file btConvexInternalShape.h.

       {
              getAabbSlow(t,aabbMin,aabbMax);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void btConvexInternalShape::getAabbSlow ( const btTransform t,
btVector3 aabbMin,
btVector3 aabbMax 
) const [virtual, inherited]

Definition at line 34 of file btConvexInternalShape.cpp.

{

       btScalar margin = getMargin();
       for (int i=0;i<3;i++)
       {
              btVector3 vec(btScalar(0.),btScalar(0.),btScalar(0.));
              vec[i] = btScalar(1.);

              btVector3 sv = localGetSupportingVertex(vec*trans.getBasis());

              btVector3 tmp = trans(sv);
              maxAabb[i] = tmp[i]+margin;
              vec[i] = btScalar(-1.);
              tmp = trans(localGetSupportingVertex(vec*trans.getBasis()));
              minAabb[i] = tmp[i]-margin;
       }
};

Here is the call graph for this function:

Here is the caller graph for this function:

const btVector3& btConvexInternalShape::getImplicitShapeDimensions ( ) const [inline, inherited]

Definition at line 40 of file btConvexInternalShape.h.

virtual const btVector3& btConvexInternalShape::getLocalScaling ( ) const [inline, virtual, inherited]

Reimplemented in btConvexTriangleMeshShape.

Definition at line 57 of file btConvexInternalShape.h.

       {
              return m_localScaling;
       }
const btVector3& btConvexInternalShape::getLocalScalingNV ( ) const [inline, inherited]

Definition at line 62 of file btConvexInternalShape.h.

       {
              return m_localScaling;
       }

Reimplemented from btConvexInternalShape.

Definition at line 46 of file btMinkowskiSumShape.cpp.

{
       return m_shapeA->getMargin() + m_shapeB->getMargin();
}
btScalar btConvexInternalShape::getMarginNV ( ) const [inline, inherited]

Definition at line 76 of file btConvexInternalShape.h.

       {
              return m_collisionMargin;
       }
virtual const char* btMinkowskiSumShape::getName ( ) const [inline, virtual]

Definition at line 56 of file btMinkowskiSumShape.h.

       {
              return "MinkowskiSum";
       }
virtual int btConvexInternalShape::getNumPreferredPenetrationDirections ( ) const [inline, virtual, inherited]

Reimplemented in btBoxShape, and btTriangleShape.

Definition at line 81 of file btConvexInternalShape.h.

       {
              return 0;
       }
virtual void btConvexInternalShape::getPreferredPenetrationDirection ( int  index,
btVector3 penetrationVector 
) const [inline, virtual, inherited]

Reimplemented in btBoxShape, and btTriangleShape.

Definition at line 86 of file btConvexInternalShape.h.

       {
              (void)penetrationVector;
              (void)index;
              btAssert(0);
       }
const btConvexShape* btMinkowskiSumShape::getShapeA ( ) const [inline]

Definition at line 53 of file btMinkowskiSumShape.h.

{ return m_shapeA;}
const btConvexShape* btMinkowskiSumShape::getShapeB ( ) const [inline]

Definition at line 54 of file btMinkowskiSumShape.h.

{ return m_shapeB;}
virtual int btMinkowskiSumShape::getShapeType ( ) const [inline, virtual]

Definition at line 49 of file btMinkowskiSumShape.h.

Definition at line 45 of file btMinkowskiSumShape.h.

{ return m_transA;}

Definition at line 46 of file btMinkowskiSumShape.h.

{ return m_transB;}
btVector3 btConvexInternalShape::localGetSupportingVertex ( const btVector3 vec) const [virtual, inherited]

Reimplemented in btBoxShape, btCylinderShape, btConeShape, and btConvexTriangleMeshShape.

Definition at line 54 of file btConvexInternalShape.cpp.

{
#ifndef __SPU__

        btVector3    supVertex = localGetSupportingVertexWithoutMargin(vec);

       if ( getMargin()!=btScalar(0.) )
       {
              btVector3 vecnorm = vec;
              if (vecnorm .length2() < (SIMD_EPSILON*SIMD_EPSILON))
              {
                     vecnorm.setValue(btScalar(-1.),btScalar(-1.),btScalar(-1.));
              } 
              vecnorm.normalize();
              supVertex+= getMargin() * vecnorm;
       }
       return supVertex;

#else
       return btVector3(0,0,0);
#endif //__SPU__

 }

Here is the call graph for this function:

Here is the caller graph for this function:

Implements btConvexInternalShape.

Definition at line 27 of file btMinkowskiSumShape.cpp.

{
       btVector3 supVertexA = m_transA(m_shapeA->localGetSupportingVertexWithoutMargin(-vec*m_transA.getBasis()));
       btVector3 supVertexB = m_transB(m_shapeB->localGetSupportingVertexWithoutMargin(vec*m_transB.getBasis()));
       return  supVertexA - supVertexB;
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

Reimplemented in btBoxShape, and btConvexTriangleMeshShape.

Definition at line 27 of file btConvexInternalShape.cpp.

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

Reimplemented in btBoxShape.

Definition at line 67 of file btConvexInternalShape.h.

       {
              m_collisionMargin = margin;
       }

Here is the caller graph for this function:

void btMinkowskiSumShape::setTransformA ( const btTransform transA) [inline]

Definition at line 42 of file btMinkowskiSumShape.h.

{ m_transA = transA;}
void btMinkowskiSumShape::setTransformB ( const btTransform transB) [inline]

Definition at line 43 of file btMinkowskiSumShape.h.

{ m_transB = transB;}

Member Data Documentation

Definition at line 18 of file btConvexInternalShape.h.

Definition at line 16 of file btConvexInternalShape.h.

Definition at line 14 of file btConvexInternalShape.h.

Definition at line 20 of file btConvexInternalShape.h.

const btConvexShape* btMinkowskiSumShape::m_shapeA [private]

Definition at line 28 of file btMinkowskiSumShape.h.

const btConvexShape* btMinkowskiSumShape::m_shapeB [private]

Definition at line 29 of file btMinkowskiSumShape.h.

Definition at line 26 of file btMinkowskiSumShape.h.

Definition at line 27 of file btMinkowskiSumShape.h.


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