24#define BTMBSLIDERCONSTRAINT_DIM 5
25#define EPSILON 0.000001
35 m_jointAxis(jointAxis)
48 m_jointAxis(jointAxis)
137 for (
int i = 0; i < 3; ++i)
140 if (constraintAxis[0].safeNorm() >
EPSILON)
142 constraintAxis[0] = constraintAxis[0].
normalized();
143 constraintAxis[1] = jointAxis.
cross(constraintAxis[0]);
144 constraintAxis[1] = constraintAxis[1].
normalized();
154 for (
int i = 0; i < numDim; i++)
183 constraintNormalLin = constraintAxis[i];
184 posError = (pivotAworld - pivotBworld).
dot(constraintNormalLin);
186 constraintNormalLin, pivotAworld, pivotBworld,
193 constraintNormalAng = frameAworld.
getColumn(i % 3);
194 posError = angleDiff[i % 3];
196 constraintNormalLin, pivotAworld, pivotBworld,
@ MULTIBODY_CONSTRAINT_SLIDER
#define BTMBSLIDERCONSTRAINT_DIM
This file was written by Erwin Coumans.
btScalar dot(const btQuaternion &q1, const btQuaternion &q2)
Calculate the dot product between two quaternions.
btVector3 quatRotate(const btQuaternion &rotation, const btVector3 &v)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
void resize(int newsize, const T &fillData=T())
T & expandNonInitializing()
int getCompanionId() const
static bool matrixToEulerXYZ(const btMatrix3x3 &mat, btVector3 &xyz)
The btIDebugDraw interface class allows hooking up a debug renderer to visually debug simulations.
virtual void drawTransform(const btTransform &transform, btScalar orthoLen)
The btMatrix3x3 class implements a 3x3 rotation matrix, to perform linear algebra in combination with...
btMatrix3x3 inverse() const
Return the inverse of the matrix.
btMatrix3x3 transpose() const
Return the transpose of the matrix.
btVector3 getColumn(int i) const
Get a column of the matrix as a vector.
btAlignedObjectArray< btScalar > m_data
btScalar m_maxAppliedImpulse
btScalar fillMultiBodyConstraint(btMultiBodySolverConstraint &solverConstraint, btMultiBodyJacobianData &data, btScalar *jacOrgA, btScalar *jacOrgB, const btVector3 &constraintNormalAng, const btVector3 &constraintNormalLin, const btVector3 &posAworld, const btVector3 &posBworld, btScalar posError, const btContactSolverInfo &infoGlobal, btScalar lowerLimit, btScalar upperLimit, bool angConstraint=false, btScalar relaxation=1.f, bool isFriction=false, btScalar desiredVelocity=0, btScalar cfmSlip=0, btScalar damping=1.0)
btRigidBody * m_rigidBodyA
virtual ~btMultiBodySliderConstraint()
virtual void createConstraintRows(btMultiBodyConstraintArray &constraintRows, btMultiBodyJacobianData &data, const btContactSolverInfo &infoGlobal)
virtual void debugDraw(class btIDebugDraw *drawer)
btMultiBodySliderConstraint(btMultiBody *body, int link, btRigidBody *bodyB, const btVector3 &pivotInA, const btVector3 &pivotInB, const btMatrix3x3 &frameInA, const btMatrix3x3 &frameInB, const btVector3 &jointAxis)
virtual int getIslandIdB() const
virtual int getIslandIdA() const
virtual void finalizeMultiDof()
btRigidBody * m_rigidBodyB
btMatrix3x3 localFrameToWorld(int i, const btMatrix3x3 &local_frame) const
const btMultibodyLink & getLink(int index) const
const btMultiBodyLinkCollider * getBaseCollider() const
btVector3 localPosToWorld(int i, const btVector3 &local_pos) const
btVector3 localDirToWorld(int i, const btVector3 &local_dir) const
The btRigidBody is the main class for rigid body objects.
btQuaternion getOrientation() const
const btTransform & getCenterOfMassTransform() const
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.
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z)
btVector3 normalized() const
Return a normalized version of this vector.
1D constraint along a normal axis between bodyA and bodyB. It can be combined to solve contact and fr...
btMultiBodyConstraint * m_orgConstraint
btVector3 m_relpos1CrossNormal
btVector3 m_contactNormal2
btVector3 m_contactNormal1
btVector3 m_angularComponentA
btVector3 m_relpos2CrossNormal
btVector3 m_angularComponentB
class btMultiBodyLinkCollider * m_collider