Limit: C = norm(pB - pA) - L u = (pB - pA) / norm(pB - pA) Cdot = dot(u, vB + cross(wB, rB) - vA - cross(wA, rA)) J = [-u -cross(rA, u) u cross(rB, u)] K = J * invM * JT = invMassA + invIA * cross(rA, u)^2 + invMassB + invIB * cross(rB, u)^2
(def *B2RopeJointDef)
| 93 | // // = invMassA + invIA * cross(rA, u)^2 + invMassB + invIB * cross(rB, u)^2 |
| 94 | |
| 95 | func MakeB2RopeJoint(def *B2RopeJointDef) *B2RopeJoint { |
| 96 | res := B2RopeJoint{ |
| 97 | B2Joint: MakeB2Joint(def), |
| 98 | } |
| 99 | |
| 100 | res.M_localAnchorA = def.LocalAnchorA |
| 101 | res.M_localAnchorB = def.LocalAnchorB |
| 102 | |
| 103 | res.M_maxLength = def.MaxLength |
| 104 | |
| 105 | res.M_mass = 0.0 |
| 106 | res.M_impulse = 0.0 |
| 107 | res.M_state = B2LimitState.E_inactiveLimit |
| 108 | res.M_length = 0.0 |
| 109 | |
| 110 | return &res |
| 111 | } |
| 112 | |
| 113 | func (joint *B2RopeJoint) InitVelocityConstraints(data B2SolverData) { |
| 114 | joint.M_indexA = joint.M_bodyA.M_islandIndex |
no test coverage detected