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++)
411 for(i = 0; i < 3; i++)
472 #ifdef _BT_USE_CENTER_LIMIT_
477 limit = (limit_err >
btScalar(0.0)) ? 1 : 2;
500 if(limit && (lostop == histop))
519 k = info->
fps * currERP;
542 #ifdef _BT_USE_CENTER_LIMIT_
545 btScalar bounce = m_relaxationFactor;
550 vel -= angVelB.
dot(ax1);
569 if(newc < info->m_constraintError[srow])
576 #ifdef _BT_USE_CENTER_LIMIT_
622 #ifdef _BT_USE_CENTER_LIMIT_
627 m_solveLimit =
false;
628 if (m_lowerLimit <= m_upperLimit)
670 if (qHinge.
getZ() < 0)
671 targetAngle = -targetAngle;
678 #ifdef _BT_USE_CENTER_LIMIT_
681 if (m_lowerLimit < m_upperLimit)
683 if (targetAngle < m_lowerLimit)
684 targetAngle = m_lowerLimit;
685 else if (targetAngle > m_upperLimit)
686 targetAngle = m_upperLimit;
691 btScalar dAngle = targetAngle - curAngle;
729 btVector3 ax1 = ax1A * factA + ax1B * factB;
752 relA = orthoA + totalDist * factA;
753 relB = orthoB - totalDist * factB;
755 p = orthoB * factA + orthoA * factB;
768 tmpA = relA.
cross(p);
769 tmpB = relB.
cross(p);
772 tmpA = relA.
cross(q);
773 tmpB = relB.
cross(q);
782 tmpA = relA.
cross(ax1);
783 tmpB = relB.
cross(ax1);
805 rhs = k * q.
dot(ofs);
807 rhs = k * ax1.
dot(ofs);
847 k = info->
fps * info->
erp;
859 #ifdef _BT_USE_CENTER_LIMIT_
864 limit = (limit_err >
btScalar(0.0)) ? 1 : 2;
887 if(limit && (lostop == histop))
906 k = info->
fps * currERP;
929 #ifdef _BT_USE_CENTER_LIMIT_
932 btScalar bounce = m_relaxationFactor;
937 vel -= angVelB.
dot(ax1);
956 if(newc < info->m_constraintError[srow])
963 #ifdef _BT_USE_CENTER_LIMIT_
977 if((axis == -1) || (axis == 5))
1007 if((axis == -1) || (axis == 5))