Back to index

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

btConeShapeZ implements a Cone shape, around the Z axis More...

#include <btConeShape.h>

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

List of all members.

Public Member Functions

 btConeShapeZ (btScalar radius, btScalar height)
virtual btVector3 localGetSupportingVertex (const btVector3 &vec) const
virtual btVector3 localGetSupportingVertexWithoutMargin (const btVector3 &vec) const
virtual void batchedUnitVectorGetSupportingVertexWithoutMargin (const btVector3 *vectors, btVector3 *supportVerticesOut, int numVectors) const
btScalar getRadius () const
btScalar getHeight () const
virtual void calculateLocalInertia (btScalar mass, btVector3 &inertia) const
virtual int getShapeType () const
virtual const char * getName () const
void setConeUpIndex (int upIndex)
 choose upAxis index
int getConeUpIndex () 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)
virtual btScalar getMargin () const
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

Detailed Description

btConeShapeZ implements a Cone shape, around the Z axis

Definition at line 97 of file btConeShape.h.


Constructor & Destructor Documentation

btConeShapeZ::btConeShapeZ ( btScalar  radius,
btScalar  height 
)

Definition at line 30 of file btConeShape.cpp.

                                                          :
btConeShape(radius,height)
{
       setConeUpIndex(2);
}

Here is the call graph for this function:


Member Function Documentation

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

Implements btConvexInternalShape.

Definition at line 107 of file btConeShape.cpp.

{
       for (int i=0;i<numVectors;i++)
       {
              const btVector3& vec = vectors[i];
              supportVerticesOut[i] = coneLocalSupport(vec);
       }
}

Here is the call graph for this function:

virtual void btConeShape::calculateLocalInertia ( btScalar  mass,
btVector3 inertia 
) const [inline, virtual, inherited]

Definition at line 45 of file btConeShape.h.

       {
              btTransform identity;
              identity.setIdentity();
              btVector3 aabbMin,aabbMax;
              getAabb(identity,aabbMin,aabbMax);

              btVector3 halfExtents = (aabbMax-aabbMin)*btScalar(0.5);

              btScalar margin = getMargin();

              btScalar lx=btScalar(2.)*(halfExtents.x()+margin);
              btScalar ly=btScalar(2.)*(halfExtents.y()+margin);
              btScalar lz=btScalar(2.)*(halfExtents.z()+margin);
              const btScalar x2 = lx*lx;
              const btScalar y2 = ly*ly;
              const btScalar z2 = lz*lz;
              const btScalar scaledmass = mass * btScalar(0.08333333);

              inertia = scaledmass * (btVector3(y2+z2,x2+z2,x2+y2));

//            inertia.x() = scaledmass * (y2+z2);
//            inertia.y() = scaledmass * (x2+z2);
//            inertia.z() = scaledmass * (x2+y2);
       }

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:

int btConeShape::getConeUpIndex ( ) const [inline, inherited]

Definition at line 83 of file btConeShape.h.

              {
                     return m_coneIndices[1];
              }

Here is the caller graph for this function:

btScalar btConeShape::getHeight ( ) const [inline, inherited]

Definition at line 42 of file btConeShape.h.

{ return m_height;}

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

Reimplemented in btMinkowskiSumShape.

Definition at line 71 of file btConvexInternalShape.h.

       {
              return m_collisionMargin;
       }

Here is the caller graph for this function:

btScalar btConvexInternalShape::getMarginNV ( ) const [inline, inherited]

Definition at line 76 of file btConvexInternalShape.h.

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

Definition at line 75 of file btConeShape.h.

              {
                     return "Cone";
              }
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);
       }
btScalar btConeShape::getRadius ( ) const [inline, inherited]

Definition at line 41 of file btConeShape.h.

{ return m_radius;}

Here is the caller graph for this function:

virtual int btConeShape::getShapeType ( ) const [inline, virtual, inherited]

Definition at line 73 of file btConeShape.h.

btVector3 btConeShape::localGetSupportingVertex ( const btVector3 vec) const [virtual, inherited]

Reimplemented from btConvexInternalShape.

Definition at line 117 of file btConeShape.cpp.

{
       btVector3 supVertex = coneLocalSupport(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;
}

Here is the call graph for this function:

btVector3 btConeShape::localGetSupportingVertexWithoutMargin ( const btVector3 vec) const [virtual, inherited]

Implements btConvexInternalShape.

Definition at line 102 of file btConeShape.cpp.

{
              return coneLocalSupport(vec);
}

Here is the call graph for this function:

void btConeShape::setConeUpIndex ( int  upIndex) [inherited]

choose upAxis index

Definition at line 43 of file btConeShape.cpp.

{
       switch (upIndex)
       {
       case 0:
                     m_coneIndices[0] = 1;
                     m_coneIndices[1] = 0;
                     m_coneIndices[2] = 2;
              break;
       case 1:
                     m_coneIndices[0] = 0;
                     m_coneIndices[1] = 1;
                     m_coneIndices[2] = 2;
              break;
       case 2:
                     m_coneIndices[0] = 0;
                     m_coneIndices[1] = 2;
                     m_coneIndices[2] = 1;
              break;
       default:
              assert(0);
       };
}

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:


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.


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