26 #define USE_OFFSET_FOR_CONSTANT_FRAME true 79 m_useSolveConstraintObsolete(false),
82 m_useLinearReferenceFrameA(useLinearReferenceFrameA)
89 m_useSolveConstraintObsolete(false),
91 m_useLinearReferenceFrameA(useLinearReferenceFrameA)
166 for (i = 0; i < 3; i++)
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)
658 if (newc < info->m_constraintError[srow])
btScalar * m_constraintError
void calculateTransforms(const btTransform &transA, const btTransform &transB)
#define SLIDER_CONSTRAINT_DEF_RESTITUTION
btScalar m_dampingOrthoAng
btScalar getMaxAngMotorForce()
btScalar * m_J2angularAxis
const btVector3 & getAngularVelocity() const
virtual btScalar getParam(int num, int axis=-1) const
return the local value of parameter
btScalar m_dampingOrthoLin
const btTransform & getCalculatedTransformA() const
const btTransform & getCalculatedTransformB() const
#define USE_OFFSET_FOR_CONSTANT_FRAME
void getInfo2NonVirtual(btConstraintInfo2 *info, const btTransform &transA, const btTransform &transB, const btVector3 &linVelA, const btVector3 &linVelB, btScalar rbAinvMass, btScalar rbBinvMass)
virtual void getInfo2(btConstraintInfo2 *info)
internal method used by the constraint solver, don't use them directly
const btTransform & getCenterOfMassTransform() const
btScalar m_restitutionOrthoAng
btScalar length2() const
Return the length of the vector squared.
btScalar m_accumulatedAngMotorImpulse
void btPlaneSpace1(const T &n, T &p, T &q)
btScalar btSqrt(btScalar y)
btScalar m_accumulatedLinMotorImpulse
btScalar getLowerLinLimit()
btTransform m_calculatedTransformB
bool getPoweredLinMotor()
btScalar * m_J1angularAxis
btScalar m_targetLinMotorVelocity
bool getPoweredAngMotor()
btVector3 & normalize()
Normalize this vector x^2 + y^2 + z^2 = 1.
btSliderConstraint(btRigidBody &rbA, btRigidBody &rbB, const btTransform &frameInA, const btTransform &frameInB, bool useLinearReferenceFrameA)
btScalar getMaxLinMotorForce()
btVector3 getColumn(int i) const
Get a column of the matrix as a vector.
btScalar m_restitutionLimLin
btScalar getUpperAngLimit()
btScalar * m_J1linearAxis
btScalar m_softnessLimLin
const btVector3 & getLinearVelocity() const
btScalar m_restitutionLimAng
btScalar getInvMass() const
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 m_restitutionDirAng
btScalar btAtan2(btScalar x, btScalar y)
#define SLIDER_CONSTRAINT_DEF_CFM
btScalar getDampingLimAng()
btScalar m_softnessDirLin
The btRigidBody is the main class for rigid body objects.
btVector3 m_realPivotBInW
btScalar m_softnessOrthoLin
btScalar m_targetAngMotorVelocity
virtual void getInfo1(btConstraintInfo1 *info)
internal method used by the constraint solver, don't use them directly
bool m_useOffsetForConstraintFrame
btScalar getUpperLinLimit()
btScalar getTargetLinMotorVelocity()
#define SLIDER_CONSTRAINT_DEF_SOFTNESS
void getInfo1NonVirtual(btConstraintInfo1 *info)
btScalar btAdjustAngleToLimits(btScalar angleInRadians, btScalar angleLowerLimitInRadians, btScalar angleUpperLimitInRadians)
btVector3 can be used to represent 3D points and vectors.
bool m_useLinearReferenceFrameA
btScalar getTargetAngMotorVelocity()
btScalar * m_J2linearAxis
btTransform m_calculatedTransformA
TypedConstraint is the baseclass for Bullet constraints and vehicles.
btScalar getSoftnessLimLin()
btScalar getMotorFactor(btScalar pos, btScalar lowLim, btScalar uppLim, btScalar vel, btScalar timeFact)
internal method used by the constraint solver, don't use them directly
btVector3 m_realPivotAInW
btScalar m_softnessDirAng
bool m_useSolveConstraintObsolete
for backwards compatibility during the transition to 'getInfo/getInfo2'
btScalar m_maxLinMotorForce
btScalar getLowerAngLimit()
btScalar m_restitutionDirLin
btScalar m_maxAngMotorForce
#define btAssertConstrParams(_par)
btScalar m_softnessLimAng
btScalar getDampingLimLin()
btScalar m_restitutionOrthoLin
btScalar m_softnessOrthoAng
btScalar getSoftnessLimAng()
#define SLIDER_CONSTRAINT_DEF_DAMPING
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
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 btFabs(btScalar x)