void b3Generic6DofConstraint::getInfo2 (b3ConstraintInfo2* info,const b3RigidBodyData* bodies) { b3Transform transA = getCenterOfMassTransform(bodies[m_rbA]); b3Transform transB = getCenterOfMassTransform(bodies[m_rbB]); const b3Vector3& linVelA = bodies[m_rbA].m_linVel; const b3Vector3& linVelB = bodies[m_rbB].m_linVel; const b3Vector3& angVelA = bodies[m_rbA].m_angVel; const b3Vector3& angVelB = bodies[m_rbB].m_angVel; if(m_useOffsetForConstraintFrame) { // for stability better to solve angular limits first int row = setAngularLimits(info, 0,transA,transB,linVelA,linVelB,angVelA,angVelB); setLinearLimits(info, row, transA,transB,linVelA,linVelB,angVelA,angVelB); } else { // leave old version for compatibility int row = setLinearLimits(info, 0, transA,transB,linVelA,linVelB,angVelA,angVelB); setAngularLimits(info, row,transA,transB,linVelA,linVelB,angVelA,angVelB); } }
void btGeneric6DofSpring2Constraint::getInfo2 (btConstraintInfo2* info) { const btTransform& transA = m_rbA.getCenterOfMassTransform(); const btTransform& transB = m_rbB.getCenterOfMassTransform(); const btVector3& linVelA = m_rbA.getLinearVelocity(); const btVector3& linVelB = m_rbB.getLinearVelocity(); const btVector3& angVelA = m_rbA.getAngularVelocity(); const btVector3& angVelB = m_rbB.getAngularVelocity(); // for stability better to solve angular limits first int row = setAngularLimits(info, 0,transA,transB,linVelA,linVelB,angVelA,angVelB); setLinearLimits(info, row, transA,transB,linVelA,linVelB,angVelA,angVelB); }
void btGeneric6DofConstraint::getInfo2(btConstraintInfo2* info) { btAssert(!m_useSolveConstraintObsolete); const btTransform& transA = m_rbA.getCenterOfMassTransform(); const btTransform& transB = m_rbB.getCenterOfMassTransform(); const btVector3& linVelA = m_rbA.getLinearVelocity(); const btVector3& linVelB = m_rbB.getLinearVelocity(); const btVector3& angVelA = m_rbA.getAngularVelocity(); const btVector3& angVelB = m_rbB.getAngularVelocity(); if (m_useOffsetForConstraintFrame) { // for stability better to solve angular limits first int row = setAngularLimits(info, 0, transA, transB, linVelA, linVelB, angVelA, angVelB); setLinearLimits(info, row, transA, transB, linVelA, linVelB, angVelA, angVelB); } else { // leave old version for compatibility int row = setLinearLimits(info, 0, transA, transB, linVelA, linVelB, angVelA, angVelB); setAngularLimits(info, row, transA, transB, linVelA, linVelB, angVelA, angVelB); } }
void b3Generic6DofConstraint::getInfo2NonVirtual (b3ConstraintInfo2* info, const b3Transform& transA,const b3Transform& transB,const b3Vector3& linVelA,const b3Vector3& linVelB,const b3Vector3& angVelA,const b3Vector3& angVelB,const b3RigidBodyData* bodies) { //prepare constraint calculateTransforms(transA,transB,bodies); int i; for (i=0;i<3 ;i++ ) { testAngularLimitMotor(i); } if(m_useOffsetForConstraintFrame) { // for stability better to solve angular limits first int row = setAngularLimits(info, 0,transA,transB,linVelA,linVelB,angVelA,angVelB); setLinearLimits(info, row, transA,transB,linVelA,linVelB,angVelA,angVelB); } else { // leave old version for compatibility int row = setLinearLimits(info, 0, transA,transB,linVelA,linVelB,angVelA,angVelB); setAngularLimits(info, row,transA,transB,linVelA,linVelB,angVelA,angVelB); } }
void btGeneric6DofConstraint::getInfo2NonVirtual(btConstraintInfo2* info, const btTransform& transA, const btTransform& transB, const btVector3& linVelA, const btVector3& linVelB, const btVector3& angVelA, const btVector3& angVelB) { btAssert(!m_useSolveConstraintObsolete); //prepare constraint calculateTransforms(transA, transB); int i; for (i = 0; i < 3; i++) { testAngularLimitMotor(i); } if (m_useOffsetForConstraintFrame) { // for stability better to solve angular limits first int row = setAngularLimits(info, 0, transA, transB, linVelA, linVelB, angVelA, angVelB); setLinearLimits(info, row, transA, transB, linVelA, linVelB, angVelA, angVelB); } else { // leave old version for compatibility int row = setLinearLimits(info, 0, transA, transB, linVelA, linVelB, angVelA, angVelB); setAngularLimits(info, row, transA, transB, linVelA, linVelB, angVelA, angVelB); } }
void setAngularLimits(const Ogre::Vector3 angularLowerLimit, const Ogre::Vector3 angularUpperLimit) { setAngularLimits(OgreBulletUtils::convert(angularLowerLimit), OgreBulletUtils::convert(angularUpperLimit)); }
void btGeneric6DofConstraint::getInfo2 (btConstraintInfo2* info) { btAssert(!m_useSolveConstraintObsolete); int row = setLinearLimits(info); setAngularLimits(info, row); }