Back to index

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

#include <btUniformScalingShape.h>

List of all members.

Public Member Functions

 btUniformScalingShape (btConvexShape *convexChildShape, btScalar uniformScalingFactor)
virtual ~btUniformScalingShape ()
virtual btVector3 localGetSupportingVertexWithoutMargin (const btVector3 &vec) const
virtual btVector3 localGetSupportingVertex (const btVector3 &vec) const
virtual void batchedUnitVectorGetSupportingVertexWithoutMargin (const btVector3 *vectors, btVector3 *supportVerticesOut, int numVectors) const
virtual void calculateLocalInertia (btScalar mass, btVector3 &inertia) const
btScalar getUniformScalingFactor () const
btConvexShape * getChildShape ()
const btConvexShape * getChildShape () const
virtual const char * getName () const
virtual int getShapeType () 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
virtual void setMargin (btScalar margin)
virtual btScalar getMargin () const
virtual int getNumPreferredPenetrationDirections () const
virtual void getPreferredPenetrationDirection (int index, btVector3 &penetrationVector) const

Private Attributes

btConvexShape * m_childConvexShape
btScalar m_uniformScalingFactor

Detailed Description

Definition at line 22 of file btUniformScalingShape.h.


Constructor & Destructor Documentation

btUniformScalingShape::btUniformScalingShape ( btConvexShape *  convexChildShape,
btScalar  uniformScalingFactor 
)

Definition at line 18 of file btUniformScalingShape.cpp.

                                                                                                               :
m_childConvexShape(convexChildShape),
m_uniformScalingFactor(uniformScalingFactor)
{
}

Definition at line 24 of file btUniformScalingShape.cpp.

{
}

Member Function Documentation

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

Definition at line 36 of file btUniformScalingShape.cpp.

{
       m_childConvexShape->batchedUnitVectorGetSupportingVertexWithoutMargin(vectors,supportVerticesOut,numVectors);
       int i;
       for (i=0;i<numVectors;i++)
       {
              supportVerticesOut[i] = supportVerticesOut[i] * m_uniformScalingFactor;
       }
}
void btUniformScalingShape::calculateLocalInertia ( btScalar  mass,
btVector3 inertia 
) const [virtual]

this linear upscaling is not realistic, but we don't deal with large mass ratios...

Definition at line 55 of file btUniformScalingShape.cpp.

{

       btVector3 tmpInertia;
       m_childConvexShape->calculateLocalInertia(mass,tmpInertia);
       inertia = tmpInertia * m_uniformScalingFactor;
}
void btUniformScalingShape::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

Definition at line 66 of file btUniformScalingShape.cpp.

{
       m_childConvexShape->getAabb(t,aabbMin,aabbMax);
       btVector3 aabbCenter = (aabbMax+aabbMin)*btScalar(0.5);
       btVector3 scaledAabbHalfExtends = (aabbMax-aabbMin)*btScalar(0.5)*m_uniformScalingFactor;

       aabbMin = aabbCenter - scaledAabbHalfExtends;
       aabbMax = aabbCenter + scaledAabbHalfExtends;

}
void btUniformScalingShape::getAabbSlow ( const btTransform t,
btVector3 aabbMin,
btVector3 aabbMax 
) const [virtual]

Definition at line 77 of file btUniformScalingShape.cpp.

{
       m_childConvexShape->getAabbSlow(t,aabbMin,aabbMax);
       btVector3 aabbCenter = (aabbMax+aabbMin)*btScalar(0.5);
       btVector3 scaledAabbHalfExtends = (aabbMax-aabbMin)*btScalar(0.5)*m_uniformScalingFactor;

       aabbMin = aabbCenter - scaledAabbHalfExtends;
       aabbMax = aabbCenter + scaledAabbHalfExtends;
}
btConvexShape* btUniformScalingShape::getChildShape ( ) [inline]

Definition at line 47 of file btUniformScalingShape.h.

       {
              return m_childConvexShape;
       }

Here is the caller graph for this function:

const btConvexShape* btUniformScalingShape::getChildShape ( ) const [inline]

Definition at line 52 of file btUniformScalingShape.h.

       {
              return m_childConvexShape;
       }

Definition at line 92 of file btUniformScalingShape.cpp.

{
       return m_childConvexShape->getLocalScaling();
}

Definition at line 101 of file btUniformScalingShape.cpp.

{
       return m_childConvexShape->getMargin() * m_uniformScalingFactor;
}
virtual const char* btUniformScalingShape::getName ( ) const [inline, virtual]

Definition at line 57 of file btUniformScalingShape.h.

       {
              return "UniformScalingShape";
       }

Definition at line 106 of file btUniformScalingShape.cpp.

{
       return m_childConvexShape->getNumPreferredPenetrationDirections();
}
void btUniformScalingShape::getPreferredPenetrationDirection ( int  index,
btVector3 penetrationVector 
) const [virtual]

Definition at line 111 of file btUniformScalingShape.cpp.

{
       m_childConvexShape->getPreferredPenetrationDirection(index,penetrationVector);
}
virtual int btUniformScalingShape::getShapeType ( ) const [inline, virtual]

Definition at line 62 of file btUniformScalingShape.h.

Definition at line 42 of file btUniformScalingShape.h.

Here is the caller graph for this function:

Definition at line 47 of file btUniformScalingShape.cpp.

{
       btVector3 tmpVertex;
       tmpVertex = m_childConvexShape->localGetSupportingVertex(vec);
       return tmpVertex*m_uniformScalingFactor;
}

Definition at line 29 of file btUniformScalingShape.cpp.

{
       btVector3 tmpVertex;
       tmpVertex = m_childConvexShape->localGetSupportingVertexWithoutMargin(vec);
       return tmpVertex*m_uniformScalingFactor;
}
void btUniformScalingShape::setLocalScaling ( const btVector3 scaling) [virtual]

Definition at line 87 of file btUniformScalingShape.cpp.

{
       m_childConvexShape->setLocalScaling(scaling);
}
void btUniformScalingShape::setMargin ( btScalar  margin) [virtual]

Definition at line 97 of file btUniformScalingShape.cpp.

{
       m_childConvexShape->setMargin(margin);
}

Member Data Documentation

Definition at line 24 of file btUniformScalingShape.h.

Definition at line 26 of file btUniformScalingShape.h.


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