9 #include "imstkRbdConstraint.h" 11 using namespace imstk;
22 std::shared_ptr<RigidBody> obj,
23 const Quatd& fixedOrientation,
24 const double beta = 0.05) :
RbdConstraint(obj,
nullptr, Side::A),
25 m_fixedOrientation(fixedOrientation),
38 J = Eigen::Matrix<double, 3, 4>::Zero();
39 if ((m_side == Side::AB || m_side == Side::A) && !m_obj1->m_isStatic)
41 const Quatd dq = m_fixedOrientation * m_obj1->getOrientation().inverse();
42 const Rotd angleAxes = Rotd(dq);
43 const Vec3d rotAxes = angleAxes.axis();
44 vu = angleAxes.angle() * m_beta / dt;
45 J(0, 0) = 0.0; J(0, 1) = rotAxes[0];
46 J(1, 0) = 0.0; J(1, 1) = rotAxes[1];
47 J(2, 0) = 0.0; J(2, 1) = rotAxes[2];
52 Quatd m_fixedOrientation;
Abstract class for rigid body constraints. A RbdConstraint should mainly provide a constraint jacobia...
void compute(double dt) override
Compute constraint jacobian.
Constrains the orientation to some fixed orientation.