Back to index

supertuxkart  0.5+dfsg1
Functions
btSolverBody.h File Reference
#include "LinearMath/btVector3.h"
#include "LinearMath/btMatrix3x3.h"
#include "BulletDynamics/Dynamics/btRigidBody.h"
#include "LinearMath/btAlignedAllocator.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 ATTRIBUTE_ALIGNED16 (struct) btSolverBody
 btSolverBody is an internal datastructure for the constraint solver. Only necessary data is packed to increase cache coherence/performance.

Function Documentation

ATTRIBUTE_ALIGNED16 ( struct  )

btSolverBody is an internal datastructure for the constraint solver. Only necessary data is packed to increase cache coherence/performance.

Definition at line 27 of file btSolverBody.h.

{
       BT_DECLARE_ALIGNED_ALLOCATOR();
       
       btVector3            m_angularVelocity;
       float                m_angularFactor;
       float                m_invMass;
       float                m_friction;
       btRigidBody*  m_originalBody;
       btVector3            m_linearVelocity;
       btVector3            m_centerOfMassPosition;
       
       SIMD_FORCE_INLINE void      getVelocityInLocalPoint(const btVector3& rel_pos, btVector3& velocity ) const
       {
              velocity = m_linearVelocity + m_angularVelocity.cross(rel_pos);
       }

       //Optimization for the iterative solver: avoid calculating constant terms involving inertia, normal, relative position
       SIMD_FORCE_INLINE void internalApplyImpulse(const btVector3& linearComponent, const btVector3& angularComponent,btScalar impulseMagnitude)
       {
              m_linearVelocity += linearComponent*impulseMagnitude;
              m_angularVelocity += angularComponent*(impulseMagnitude*m_angularFactor);
       }

       void   writebackVelocity()
       {
              if (m_invMass)
              {
                     m_originalBody->setLinearVelocity(m_linearVelocity);
                     m_originalBody->setAngularVelocity(m_angularVelocity);
                     //m_originalBody->setCompanionId(-1);
              }
       }

       void   readVelocity()
       {
              if (m_invMass)
              {
                     m_linearVelocity = m_originalBody->getLinearVelocity();
                     m_angularVelocity = m_originalBody->getAngularVelocity();
              }
       }

       


};

Here is the call graph for this function: