26#define USE_OFFSET_FOR_CONSTANT_FRAME true
166 for (i = 0; i < 3; i++)
230 ancorInA =
m_rbA.getCenterOfMassTransform().inverse() * ancorInA;
275 ax1 = ax1A * factA + ax1B * factB;
351 btVector3 tmpA(0, 0, 0), tmpB(0, 0, 0), relA(0, 0, 0), relB(0, 0, 0), c(0, 0, 0);
367 btVector3 totalDist = projA + ax1 * sliderOffs - projB;
369 relA = orthoA + totalDist * factA;
370 relB = orthoB - totalDist * factB;
372 p = orthoB * factA + orthoA * factB;
385 tmpA = relA.
cross(p);
386 tmpB = relB.
cross(p);
389 tmpA = relA.cross(q);
390 tmpB = relB.cross(q);
409 for (i = 0; i < 3; i++) info->
m_J1angularAxis[s2 + i] = factA * tmp[i];
410 for (i = 0; i < 3; i++) info->
m_J2angularAxis[s2 + i] = factB * tmp[i];
412 for (i = 0; i < 3; i++) info->
m_J1angularAxis[s3 + i] = factA * tmp[i];
413 for (i = 0; i < 3; i++) info->
m_J2angularAxis[s3 + i] = factB * tmp[i];
424 k = info->
fps * currERP;
428 rhs = k * q.
dot(ofs);
442 limit = (limit_err >
btScalar(0.0)) ? 2 : 1;
446 if (limit || powered)
468 tmpA = relA.cross(ax1);
469 tmpB = relB.cross(ax1);
492 if (limit && (lostop == histop))
514 k = info->
fps * currERP;
520 if (lostop == histop)
540 vel -= linVelB.
dot(ax1);
560 if (newc < info->m_constraintError[srow])
576 limit = (limit_err >
btScalar(0.0)) ? 1 : 2;
580 if (limit || powered)
594 if (limit && (lostop == histop))
612 k = info->
fps * currERP;
618 if (lostop == histop)
639 vel -=
m_rbB.getAngularVelocity().dot(ax1);
658 if (newc < info->m_constraintError[srow])
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
btScalar btSqrt(btScalar y)
btScalar btAtan2(btScalar x, btScalar y)
btScalar btFabs(btScalar x)
#define USE_OFFSET_FOR_CONSTANT_FRAME
@ BT_SLIDER_FLAGS_CFM_DIRANG
@ BT_SLIDER_FLAGS_ERP_LIMLIN
@ BT_SLIDER_FLAGS_CFM_DIRLIN
@ BT_SLIDER_FLAGS_CFM_ORTANG
@ BT_SLIDER_FLAGS_CFM_ORTLIN
@ BT_SLIDER_FLAGS_ERP_ORTANG
@ BT_SLIDER_FLAGS_CFM_LIMANG
@ BT_SLIDER_FLAGS_ERP_ORTLIN
@ BT_SLIDER_FLAGS_CFM_LIMLIN
@ BT_SLIDER_FLAGS_ERP_LIMANG
#define SLIDER_CONSTRAINT_DEF_DAMPING
#define SLIDER_CONSTRAINT_DEF_SOFTNESS
#define SLIDER_CONSTRAINT_DEF_RESTITUTION
#define SLIDER_CONSTRAINT_DEF_CFM
#define btAssertConstrParams(_par)
btScalar btAdjustAngleToLimits(btScalar angleInRadians, btScalar angleLowerLimitInRadians, btScalar angleUpperLimitInRadians)
void btPlaneSpace1(const T &n, T &p, T &q)
btVector3 getColumn(int i) const
Get a column of the matrix as a vector.
The btRigidBody is the main class for rigid body objects.
const btTransform & getCenterOfMassTransform() const
bool m_useLinearReferenceFrameA
btScalar getUpperLinLimit()
btScalar getTargetLinMotorVelocity()
bool getPoweredLinMotor()
btScalar m_softnessDirAng
btScalar m_dampingOrthoAng
btScalar m_softnessLimLin
btSliderConstraint(btRigidBody &rbA, btRigidBody &rbB, const btTransform &frameInA, const btTransform &frameInB, bool useLinearReferenceFrameA)
btScalar m_softnessDirLin
btTransform m_calculatedTransformB
bool m_useOffsetForConstraintFrame
const btTransform & getCalculatedTransformB() const
btScalar m_softnessLimAng
btTransform m_calculatedTransformA
btVector3 m_realPivotBInW
btScalar m_restitutionDirLin
virtual btScalar getParam(int num, int axis=-1) const
return the local value of parameter
btScalar m_targetLinMotorVelocity
btScalar m_targetAngMotorVelocity
btScalar m_maxAngMotorForce
btScalar m_restitutionLimAng
btScalar getLowerLinLimit()
const btTransform & getCalculatedTransformA() const
btScalar getDampingLimLin()
btScalar m_softnessOrthoAng
btScalar getDampingLimAng()
btScalar getLowerAngLimit()
btScalar m_restitutionOrthoLin
virtual void getInfo2(btConstraintInfo2 *info)
internal method used by the constraint solver, don't use them directly
btScalar getSoftnessLimAng()
btScalar m_accumulatedLinMotorImpulse
btScalar getTargetAngMotorVelocity()
void calculateTransforms(const btTransform &transA, const btTransform &transB)
btScalar m_accumulatedAngMotorImpulse
btScalar m_softnessOrthoLin
virtual void setParam(int num, btScalar value, int axis=-1)
override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0...
btScalar m_dampingOrthoLin
virtual void getInfo1(btConstraintInfo1 *info)
internal method used by the constraint solver, don't use them directly
btScalar getMaxAngMotorForce()
btVector3 m_realPivotAInW
btScalar getSoftnessLimLin()
btScalar m_maxLinMotorForce
btScalar getMaxLinMotorForce()
void getInfo2NonVirtual(btConstraintInfo2 *info, const btTransform &transA, const btTransform &transB, const btVector3 &linVelA, const btVector3 &linVelB, btScalar rbAinvMass, btScalar rbBinvMass)
btScalar m_restitutionOrthoAng
btScalar m_restitutionDirAng
bool m_useSolveConstraintObsolete
for backwards compatibility during the transition to 'getInfo/getInfo2'
btScalar getUpperAngLimit()
btScalar m_restitutionLimLin
bool getPoweredAngMotor()
void getInfo1NonVirtual(btConstraintInfo1 *info)
btScalar getMotorFactor(btScalar pos, btScalar lowLim, btScalar uppLim, btScalar vel, btScalar timeFact)
internal method used by the constraint solver, don't use them directly
static btRigidBody & getFixedBody()
btTypedConstraint(btTypedConstraintType type, btRigidBody &rbA)
btVector3 can be used to represent 3D points and vectors.
btVector3 cross(const btVector3 &v) const
Return the cross product between this and another vector.
btScalar dot(const btVector3 &v) const
Return the dot product.
btScalar length2() const
Return the length of the vector squared.
btVector3 & normalize()
Normalize this vector x^2 + y^2 + z^2 = 1.
btScalar * m_J2angularAxis
btScalar * m_J1linearAxis
btScalar * m_J2linearAxis
btScalar * m_J1angularAxis
btScalar * m_constraintError