Back to index

supertuxkart  0.5+dfsg1
Functions
btCylinderShape.cpp File Reference
#include "btCylinderShape.h"
#include "LinearMath/btPoint3.h"

Go to the source code of this file.

Functions

SIMD_FORCE_INLINE btVector3 CylinderLocalSupportX (const btVector3 &halfExtents, const btVector3 &v)
btVector3 CylinderLocalSupportY (const btVector3 &halfExtents, const btVector3 &v)
btVector3 CylinderLocalSupportZ (const btVector3 &halfExtents, const btVector3 &v)

Function Documentation

SIMD_FORCE_INLINE btVector3 CylinderLocalSupportX ( const btVector3 halfExtents,
const btVector3 v 
)

Definition at line 48 of file btCylinderShape.cpp.

{
const int cylinderUpAxis = 0;
const int XX = 1;
const int YY = 0;
const int ZZ = 2;

       //mapping depends on how cylinder local orientation is
       // extents of the cylinder is: X,Y is for radius, and Z for height


       btScalar radius = halfExtents[XX];
       btScalar halfHeight = halfExtents[cylinderUpAxis];


    btVector3 tmp;
       btScalar d ;

    btScalar s = btSqrt(v[XX] * v[XX] + v[ZZ] * v[ZZ]);
    if (s != btScalar(0.0))
       {
        d = radius / s;  
              tmp[XX] = v[XX] * d;
              tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
              tmp[ZZ] = v[ZZ] * d;
              return tmp;
       }
    else
       {
           tmp[XX] = radius;
              tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
              tmp[ZZ] = btScalar(0.0);
              return tmp;
    }


}

Here is the call graph for this function:

Here is the caller graph for this function:

btVector3 CylinderLocalSupportY ( const btVector3 halfExtents,
const btVector3 v 
) [inline]

Definition at line 91 of file btCylinderShape.cpp.

{

const int cylinderUpAxis = 1;
const int XX = 0;
const int YY = 1;
const int ZZ = 2;


       btScalar radius = halfExtents[XX];
       btScalar halfHeight = halfExtents[cylinderUpAxis];


    btVector3 tmp;
       btScalar d ;

    btScalar s = btSqrt(v[XX] * v[XX] + v[ZZ] * v[ZZ]);
    if (s != btScalar(0.0))
       {
        d = radius / s;  
              tmp[XX] = v[XX] * d;
              tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
              tmp[ZZ] = v[ZZ] * d;
              return tmp;
       }
    else
       {
           tmp[XX] = radius;
              tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
              tmp[ZZ] = btScalar(0.0);
              return tmp;
    }

}

Here is the call graph for this function:

Here is the caller graph for this function:

btVector3 CylinderLocalSupportZ ( const btVector3 halfExtents,
const btVector3 v 
) [inline]

Definition at line 126 of file btCylinderShape.cpp.

{
const int cylinderUpAxis = 2;
const int XX = 0;
const int YY = 2;
const int ZZ = 1;

       //mapping depends on how cylinder local orientation is
       // extents of the cylinder is: X,Y is for radius, and Z for height


       btScalar radius = halfExtents[XX];
       btScalar halfHeight = halfExtents[cylinderUpAxis];


    btVector3 tmp;
       btScalar d ;

    btScalar s = btSqrt(v[XX] * v[XX] + v[ZZ] * v[ZZ]);
    if (s != btScalar(0.0))
       {
        d = radius / s;  
              tmp[XX] = v[XX] * d;
              tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
              tmp[ZZ] = v[ZZ] * d;
              return tmp;
       }
    else
       {
           tmp[XX] = radius;
              tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
              tmp[ZZ] = btScalar(0.0);
              return tmp;
    }


}

Here is the call graph for this function:

Here is the caller graph for this function: