27 #define HINGE_USE_OBSOLETE_SOLVER false
29 #define HINGE_USE_FRAME_OFFSET true
44 m_enableAngularMotor(false),
47 m_useReferenceFrameA(useReferenceFrameA),
64 rbAxisA2 = axisInA.
cross(rbAxisA1);
65 rbAxisA1 = rbAxisA2.
cross(axisInA);
81 #ifndef _BT_USE_CENTER_LIMIT_
86 m_relaxationFactor = 1.0f;
87 m_limitSoftness = 0.9f;
100 m_angularOnly(false), m_enableAngularMotor(false),
103 m_useReferenceFrameA(useReferenceFrameA),
129 #ifndef _BT_USE_CENTER_LIMIT_
134 m_relaxationFactor = 1.0f;
135 m_limitSoftness = 0.9f;
136 m_solveLimit =
false;
149 m_angularOnly(false),
150 m_enableAngularMotor(false),
153 m_useReferenceFrameA(useReferenceFrameA),
156 #ifndef _BT_USE_CENTER_LIMIT_
161 m_relaxationFactor = 1.0f;
162 m_limitSoftness = 0.9f;
163 m_solveLimit =
false;
175 m_angularOnly(false),
176 m_enableAngularMotor(false),
179 m_useReferenceFrameA(useReferenceFrameA),
185 #ifndef _BT_USE_CENTER_LIMIT_
190 m_relaxationFactor = 1.0f;
191 m_limitSoftness = 0.9f;
192 m_solveLimit =
false;
210 btVector3 relPos = pivotBInW - pivotAInW;
224 for (
int i=0;i<3;i++)
419 for(i = 0; i < 3; i++)
480 #ifdef _BT_USE_CENTER_LIMIT_
485 limit = (limit_err >
btScalar(0.0)) ? 1 : 2;
508 if(limit && (lostop == histop))
527 k = info->
fps * currERP;
550 #ifdef _BT_USE_CENTER_LIMIT_
553 btScalar bounce = m_relaxationFactor;
558 vel -= angVelB.
dot(ax1);
577 if(newc < info->m_constraintError[srow])
584 #ifdef _BT_USE_CENTER_LIMIT_
630 #ifdef _BT_USE_CENTER_LIMIT_
635 m_solveLimit =
false;
636 if (m_lowerLimit <= m_upperLimit)
678 if (qHinge.
getZ() < 0)
679 targetAngle = -targetAngle;
686 #ifdef _BT_USE_CENTER_LIMIT_
689 if (m_lowerLimit < m_upperLimit)
691 if (targetAngle < m_lowerLimit)
692 targetAngle = m_lowerLimit;
693 else if (targetAngle > m_upperLimit)
694 targetAngle = m_upperLimit;
699 btScalar dAngle = targetAngle - curAngle;
737 btVector3 ax1 = ax1A * factA + ax1B * factB;
760 relA = orthoA + totalDist * factA;
761 relB = orthoB - totalDist * factB;
763 p = orthoB * factA + orthoA * factB;
776 tmpA = relA.
cross(p);
777 tmpB = relB.
cross(p);
780 tmpA = relA.
cross(q);
781 tmpB = relB.
cross(q);
790 tmpA = relA.
cross(ax1);
791 tmpB = relB.
cross(ax1);
817 rhs = k * q.
dot(ofs);
819 rhs = k * ax1.
dot(ofs);
859 k = info->
fps * info->
erp;
871 #ifdef _BT_USE_CENTER_LIMIT_
876 limit = (limit_err >
btScalar(0.0)) ? 1 : 2;
899 if(limit && (lostop == histop))
918 k = info->
fps * currERP;
941 #ifdef _BT_USE_CENTER_LIMIT_
944 btScalar bounce = m_relaxationFactor;
949 vel -= angVelB.
dot(ax1);
968 if(newc < info->m_constraintError[srow])
975 #ifdef _BT_USE_CENTER_LIMIT_
989 if((axis == -1) || (axis == 5))
1019 if((axis == -1) || (axis == 5))