27 m_desiredVelocity(0, 0, 0),
28 m_desiredPosition(0,0,0,1),
45 unsigned int offset = 6 + (m_bodyA->getLink(
m_linkA).m_dofOffset + linkDoF);
65 return col->getIslandTag();
69 if (m_bodyA->getLink(
m_linkA).m_collider)
71 return m_bodyA->getLink(
m_linkA).m_collider->getIslandTag();
83 return col->getIslandTag();
123 m_bodyA->getJointPosMultiDof(
m_linkA)[1],
124 m_bodyA->getJointPosMultiDof(
m_linkA)[2],
125 m_bodyA->getJointPosMultiDof(
m_linkA)[3]);
142 btScalar velocityError = desiredVelocity - currentVelocity;
145 frameAworld.setIdentity();
146 frameAworld = m_bodyA->localFrameToWorld(
m_linkA, frameAworld);
150 switch (m_bodyA->getLink(
m_linkA).m_jointType)
154 btVector3 constraintNormalAng = frameAworld.getColumn(row % 3);
155 posError =
m_kp*angleDiff[row % 3];
161 constraintRow.m_orgConstraint =
this;
162 constraintRow.m_orgDofIndex = row;
bool matrixToEulerXYZ(const btMatrix3x3 &mat, btVector3 &xyz)
MatrixToEulerXYZ from http://www.geometrictools.com/LibFoundation/Mathematics/Wm4Matrix3....
btMatrix3x3
The btMatrix3x3 class implements a 3x3 rotation matrix, to perform linear algebra in combination with...
@ MULTIBODY_CONSTRAINT_SPHERICAL_MOTOR
void allocateJacobiansMultiDof()
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 m_maxAppliedImpulse
btScalar * jacobianA(int row)
btMultiBodySolverConstraint
1D constraint along a normal axis between bodyA and bodyB. It can be combined to solve contact and fr...
const btMultibodyLink & getLink(int index) const
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
btSequentialImpulseConstraintSolverMt int btPersistentManifold int btTypedConstraint int const btContactSolverInfo & infoGlobal
btVector3
btVector3 can be used to represent 3D points and vectors. It has an un-used w component to suit 16-by...
SIMD_FORCE_INLINE T & expandNonInitializing()
virtual int getIslandIdA() const
btVector3 m_desiredVelocity
btMultiBodySphericalJointMotor(btMultiBody *body, int link, btScalar maxMotorImpulse)
This file was written by Erwin Coumans.
virtual void finalizeMultiDof()
virtual void createConstraintRows(btMultiBodyConstraintArray &constraintRows, btMultiBodyJacobianData &data, const btContactSolverInfo &infoGlobal)
virtual int getIslandIdB() const
btQuaternion m_desiredPosition
virtual ~btMultiBodySphericalJointMotor()
The btQuaternion implements quaternion to perform linear algebra rotations in combination with btMatr...
btQuaternion inverse() const
Return the inverse of this quaternion.
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset