Back to index

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

btVector3 can be used to represent 3D points and vectors. It has an un-used w component to suit 16-byte alignment when btVector3 is stored in containers. This extra component can be used by derived classes (Quaternion?) or by user Ideally, this class should be replaced by a platform optimized SIMD version that keeps the data in registers More...

#include <btVector3.h>

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

List of all members.

Public Member Functions

SIMD_FORCE_INLINE btVector3 ()
SIMD_FORCE_INLINE btVector3 (const btQuadWordStorage &q)
SIMD_FORCE_INLINE btVector3 (const btScalar &x, const btScalar &y, const btScalar &z)
SIMD_FORCE_INLINE btVector3operator+= (const btVector3 &v)
SIMD_FORCE_INLINE btVector3operator-= (const btVector3 &v)
SIMD_FORCE_INLINE btVector3operator*= (const btScalar &s)
SIMD_FORCE_INLINE btVector3operator/= (const btScalar &s)
SIMD_FORCE_INLINE btScalar dot (const btVector3 &v) const
SIMD_FORCE_INLINE btScalar length2 () const
SIMD_FORCE_INLINE btScalar length () const
SIMD_FORCE_INLINE btScalar distance2 (const btVector3 &v) const
SIMD_FORCE_INLINE btScalar distance (const btVector3 &v) const
SIMD_FORCE_INLINE btVector3normalize ()
SIMD_FORCE_INLINE btVector3 normalized () const
SIMD_FORCE_INLINE btVector3 rotate (const btVector3 &wAxis, const btScalar angle)
SIMD_FORCE_INLINE btScalar angle (const btVector3 &v) const
SIMD_FORCE_INLINE btVector3 absolute () const
SIMD_FORCE_INLINE btVector3 cross (const btVector3 &v) const
SIMD_FORCE_INLINE btScalar triple (const btVector3 &v1, const btVector3 &v2) const
SIMD_FORCE_INLINE int minAxis () const
SIMD_FORCE_INLINE int maxAxis () const
SIMD_FORCE_INLINE int furthestAxis () const
SIMD_FORCE_INLINE int closestAxis () const
SIMD_FORCE_INLINE void setInterpolate3 (const btVector3 &v0, const btVector3 &v1, btScalar rt)
SIMD_FORCE_INLINE btVector3 lerp (const btVector3 &v, const btScalar &t) const
SIMD_FORCE_INLINE btVector3operator*= (const btVector3 &v)
SIMD_FORCE_INLINE const btScalargetX () const
SIMD_FORCE_INLINE const btScalargetY () const
SIMD_FORCE_INLINE const btScalargetZ () const
SIMD_FORCE_INLINE void setX (btScalar x)
SIMD_FORCE_INLINE void setY (btScalar y)
SIMD_FORCE_INLINE void setZ (btScalar z)
SIMD_FORCE_INLINE void setW (btScalar w)
SIMD_FORCE_INLINE const btScalarx () const
SIMD_FORCE_INLINE const btScalary () const
SIMD_FORCE_INLINE const btScalarz () const
SIMD_FORCE_INLINE const btScalarw () const
SIMD_FORCE_INLINE operator btScalar * ()
SIMD_FORCE_INLINE operator const btScalar * () const
SIMD_FORCE_INLINE void setValue (const btScalar &x, const btScalar &y, const btScalar &z)
SIMD_FORCE_INLINE void setValue (const btScalar &x, const btScalar &y, const btScalar &z, const btScalar &w)
SIMD_FORCE_INLINE void setMax (const btQuadWord &other)
SIMD_FORCE_INLINE void setMin (const btQuadWord &other)

Protected Attributes

btScalar m_x
btScalar m_y
btScalar m_z
btScalar m_unusedW

Detailed Description

btVector3 can be used to represent 3D points and vectors. It has an un-used w component to suit 16-byte alignment when btVector3 is stored in containers. This extra component can be used by derived classes (Quaternion?) or by user Ideally, this class should be replaced by a platform optimized SIMD version that keeps the data in registers

Definition at line 25 of file btVector3.h.


Constructor & Destructor Documentation

Definition at line 28 of file btVector3.h.

{}

Here is the caller graph for this function:

Definition at line 30 of file btVector3.h.

              : btQuadWord(q)
       {
       }
SIMD_FORCE_INLINE btVector3::btVector3 ( const btScalar x,
const btScalar y,
const btScalar z 
) [inline]

Definition at line 36 of file btVector3.h.

              :btQuadWord(x,y,z,btScalar(0.))
       {
       }

Member Function Documentation

Definition at line 109 of file btVector3.h.

       {
              return btVector3(
                     btFabs(m_x), 
                     btFabs(m_y), 
                     btFabs(m_z));
       }

Here is the call graph for this function:

Here is the caller graph for this function:

SIMD_FORCE_INLINE btScalar btVector3::angle ( const btVector3 v) const [inline]

Definition at line 102 of file btVector3.h.

       {
              btScalar s = btSqrt(length2() * v.length2());
              btFullAssert(s != btScalar(0.0));
              return btAcos(dot(v) / s);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

SIMD_FORCE_INLINE int btVector3::closestAxis ( ) const [inline]

Definition at line 147 of file btVector3.h.

       {
              return absolute().maxAxis();
       }

Here is the call graph for this function:

SIMD_FORCE_INLINE btVector3 btVector3::cross ( const btVector3 v) const [inline]

Definition at line 117 of file btVector3.h.

       {
              return btVector3(
                     m_y * v.z() - m_z * v.y(),
                     m_z * v.x() - m_x * v.z(),
                     m_x * v.y() - m_y * v.x());
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 285 of file btVector3.h.

{
       return (v - *this).length();
}

Here is the caller graph for this function:

Definition at line 280 of file btVector3.h.

{
       return (v - *this).length2();
}

Here is the caller graph for this function:

SIMD_FORCE_INLINE btScalar btVector3::dot ( const btVector3 v) const [inline]

Definition at line 74 of file btVector3.h.

       {
              return m_x * v.x() + m_y * v.y() + m_z * v.z();
       }

Here is the call graph for this function:

Definition at line 142 of file btVector3.h.

       {
              return absolute().minAxis();
       }

Here is the call graph for this function:

SIMD_FORCE_INLINE const btScalar& btQuadWord::getX ( ) const [inline, inherited]

Definition at line 43 of file btQuadWord.h.

{ return m_x; }

Here is the caller graph for this function:

SIMD_FORCE_INLINE const btScalar& btQuadWord::getY ( ) const [inline, inherited]

Definition at line 45 of file btQuadWord.h.

{ return m_y; }
SIMD_FORCE_INLINE const btScalar& btQuadWord::getZ ( ) const [inline, inherited]

Definition at line 47 of file btQuadWord.h.

{ return m_z; }

Here is the caller graph for this function:

Definition at line 84 of file btVector3.h.

       {
              return btSqrt(length2());
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 79 of file btVector3.h.

       {
              return dot(*this);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

SIMD_FORCE_INLINE btVector3 btVector3::lerp ( const btVector3 v,
const btScalar t 
) const [inline]

Definition at line 162 of file btVector3.h.

       {
              return btVector3(m_x + (v.x() - m_x) * t,
                     m_y + (v.y() - m_y) * t,
                     m_z + (v.z() - m_z) * t);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

SIMD_FORCE_INLINE int btVector3::maxAxis ( ) const [inline]

Definition at line 137 of file btVector3.h.

       {
              return m_x < m_y ? (m_y < m_z ? 2 : 1) : (m_x < m_z ? 2 : 0);
       }

Here is the caller graph for this function:

SIMD_FORCE_INLINE int btVector3::minAxis ( ) const [inline]

Definition at line 132 of file btVector3.h.

       {
              return m_x < m_y ? (m_x < m_z ? 0 : 2) : (m_y < m_z ? 1 : 2);
       }

Here is the caller graph for this function:

Definition at line 93 of file btVector3.h.

       {
              return *this /= length();
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 290 of file btVector3.h.

{
       return *this / length();
} 

Here is the call graph for this function:

Here is the caller graph for this function:

SIMD_FORCE_INLINE btQuadWord::operator btScalar * ( ) [inline, inherited]

Definition at line 66 of file btQuadWord.h.

{ return &m_x; }
SIMD_FORCE_INLINE btQuadWord::operator const btScalar * ( ) const [inline, inherited]

Definition at line 67 of file btQuadWord.h.

{ return &m_x; }
SIMD_FORCE_INLINE btVector3& btVector3::operator*= ( const btScalar s) [inline]

Definition at line 62 of file btVector3.h.

       {
              m_x *= s; m_y *= s; m_z *= s;
              return *this;
       }
SIMD_FORCE_INLINE btVector3& btVector3::operator*= ( const btVector3 v) [inline]

Definition at line 170 of file btVector3.h.

       {
              m_x *= v.x(); m_y *= v.y(); m_z *= v.z();
              return *this;
       }

Here is the call graph for this function:

SIMD_FORCE_INLINE btVector3& btVector3::operator+= ( const btVector3 v) [inline]

Definition at line 48 of file btVector3.h.

       {
              m_x += v.x(); m_y += v.y(); m_z += v.z();
              return *this;
       }

Here is the call graph for this function:

SIMD_FORCE_INLINE btVector3& btVector3::operator-= ( const btVector3 v) [inline]

Definition at line 56 of file btVector3.h.

       {
              m_x -= v.x(); m_y -= v.y(); m_z -= v.z();
              return *this;
       }

Here is the call graph for this function:

SIMD_FORCE_INLINE btVector3& btVector3::operator/= ( const btScalar s) [inline]

Definition at line 68 of file btVector3.h.

       {
              btFullAssert(s != btScalar(0.0));
              return *this *= btScalar(1.0) / s;
       }
SIMD_FORCE_INLINE btVector3 btVector3::rotate ( const btVector3 wAxis,
const btScalar  angle 
)

Definition at line 295 of file btVector3.h.

{
       // wAxis must be a unit lenght vector

       btVector3 o = wAxis * wAxis.dot( *this );
       btVector3 x = *this - o;
       btVector3 y;

       y = wAxis.cross( *this );

       return ( o + x * btCos( angle ) + y * btSin( angle ) );
}

Here is the call graph for this function:

SIMD_FORCE_INLINE void btVector3::setInterpolate3 ( const btVector3 v0,
const btVector3 v1,
btScalar  rt 
) [inline]

Definition at line 152 of file btVector3.h.

       {
              btScalar s = btScalar(1.0) - rt;
              m_x = s * v0.x() + rt * v1.x();
              m_y = s * v0.y() + rt * v1.y();
              m_z = s * v0.z() + rt * v1.z();
              //don't do the unused w component
              //            m_co[3] = s * v0[3] + rt * v1[3];
       }

Here is the call graph for this function:

Here is the caller graph for this function:

SIMD_FORCE_INLINE void btQuadWord::setMax ( const btQuadWord other) [inline, inherited]

Definition at line 115 of file btQuadWord.h.

              {
                     btSetMax(m_x, other.m_x);
                     btSetMax(m_y, other.m_y);
                     btSetMax(m_z, other.m_z);
                     btSetMax(m_unusedW, other.m_unusedW);
              }

Here is the call graph for this function:

Here is the caller graph for this function:

SIMD_FORCE_INLINE void btQuadWord::setMin ( const btQuadWord other) [inline, inherited]

Definition at line 123 of file btQuadWord.h.

              {
                     btSetMin(m_x, other.m_x);
                     btSetMin(m_y, other.m_y);
                     btSetMin(m_z, other.m_z);
                     btSetMin(m_unusedW, other.m_unusedW);
              }

Here is the call graph for this function:

Here is the caller graph for this function:

SIMD_FORCE_INLINE void btQuadWord::setValue ( const btScalar x,
const btScalar y,
const btScalar z 
) [inline, inherited]

Definition at line 71 of file btQuadWord.h.

              {
                     m_x=x;
                     m_y=y;
                     m_z=z;
                     m_unusedW = 0.f;
              }

Here is the call graph for this function:

SIMD_FORCE_INLINE void btQuadWord::setValue ( const btScalar x,
const btScalar y,
const btScalar z,
const btScalar w 
) [inline, inherited]

Definition at line 86 of file btQuadWord.h.

              {
                     m_x=x;
                     m_y=y;
                     m_z=z;
                     m_unusedW=w;
              }

Here is the call graph for this function:

SIMD_FORCE_INLINE void btQuadWord::setW ( btScalar  w) [inline, inherited]

Definition at line 55 of file btQuadWord.h.

{ m_unusedW = w;};

Here is the call graph for this function:

SIMD_FORCE_INLINE void btQuadWord::setX ( btScalar  x) [inline, inherited]

Definition at line 49 of file btQuadWord.h.

{ m_x = x;};

Here is the call graph for this function:

Here is the caller graph for this function:

SIMD_FORCE_INLINE void btQuadWord::setY ( btScalar  y) [inline, inherited]

Definition at line 51 of file btQuadWord.h.

{ m_y = y;};

Here is the call graph for this function:

Here is the caller graph for this function:

SIMD_FORCE_INLINE void btQuadWord::setZ ( btScalar  z) [inline, inherited]

Definition at line 53 of file btQuadWord.h.

{ m_z = z;};

Here is the call graph for this function:

Here is the caller graph for this function:

SIMD_FORCE_INLINE btScalar btVector3::triple ( const btVector3 v1,
const btVector3 v2 
) const [inline]

Definition at line 125 of file btVector3.h.

       {
              return m_x * (v1.y() * v2.z() - v1.z() * v2.y()) + 
                     m_y * (v1.z() * v2.x() - v1.x() * v2.z()) + 
                     m_z * (v1.x() * v2.y() - v1.y() * v2.x());
       }

Here is the call graph for this function:

Here is the caller graph for this function:

SIMD_FORCE_INLINE const btScalar& btQuadWord::w ( ) const [inline, inherited]

Definition at line 63 of file btQuadWord.h.

{ return m_unusedW; }

Here is the caller graph for this function:

SIMD_FORCE_INLINE const btScalar& btQuadWord::x ( ) const [inline, inherited]

Definition at line 57 of file btQuadWord.h.

{ return m_x; }
SIMD_FORCE_INLINE const btScalar& btQuadWord::y ( ) const [inline, inherited]

Definition at line 59 of file btQuadWord.h.

{ return m_y; }
SIMD_FORCE_INLINE const btScalar& btQuadWord::z ( ) const [inline, inherited]

Definition at line 61 of file btQuadWord.h.

{ return m_z; }

Member Data Documentation

btScalar btQuadWordStorage::m_unusedW [protected, inherited]

Definition at line 31 of file btQuadWord.h.

btScalar btQuadWordStorage::m_x [protected, inherited]

Definition at line 28 of file btQuadWord.h.

btScalar btQuadWordStorage::m_y [protected, inherited]

Definition at line 29 of file btQuadWord.h.

btScalar btQuadWordStorage::m_z [protected, inherited]

Definition at line 30 of file btQuadWord.h.


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