Point-to-point constraint Cdot = v2 - v1 = v2 + cross(w2, r2) - v1 - cross(w1, r1) J = [-I -r1_skew I r2_skew ] Identity used: w k % (rx i + ry j) = w * (-ry i + rx j) r1 = offset - c1 r2 = -c2 Angle constraint Cdot = w2 - w1 J = [0 0 -1 0 0 1] K = invI1 + invI2
(bA *B2Body, bB *B2Body)
| 83 | // K = invI1 + invI2 |
| 84 | |
| 85 | func (def *B2MotorJointDef) Initialize(bA *B2Body, bB *B2Body) { |
| 86 | def.BodyA = bA |
| 87 | def.BodyB = bB |
| 88 | xB := def.BodyB.GetPosition() |
| 89 | def.LinearOffset = def.BodyA.GetLocalPoint(xB) |
| 90 | |
| 91 | angleA := def.BodyA.GetAngle() |
| 92 | angleB := def.BodyB.GetAngle() |
| 93 | def.AngularOffset = angleB - angleA |
| 94 | } |
| 95 | |
| 96 | func MakeB2MotorJoint(def *B2MotorJointDef) *B2MotorJoint { |
| 97 |
nothing calls this directly
no test coverage detected