Linear constraint (point-to-line) d = pB - pA = xB + rB - xA - rA C = dot(ay, d) Cdot = dot(d, cross(wA, ay)) + dot(ay, vB + cross(wB, rB) - vA - cross(wA, rA)) = -dot(ay, vA) - dot(cross(d + rA, ay), wA) + dot(ay, vB) + dot(cross(rB, ay), vB) J = [-ay, -cross(d + rA, ay), ay, cross(rB, ay)] Spring
(bA *B2Body, bB *B2Body, anchor B2Vec2, axis B2Vec2)
| 162 | // J = [0 0 -1 0 0 1] |
| 163 | |
| 164 | func (def *B2WheelJointDef) Initialize(bA *B2Body, bB *B2Body, anchor B2Vec2, axis B2Vec2) { |
| 165 | def.BodyA = bA |
| 166 | def.BodyB = bB |
| 167 | def.LocalAnchorA = def.BodyA.GetLocalPoint(anchor) |
| 168 | def.LocalAnchorB = def.BodyB.GetLocalPoint(anchor) |
| 169 | def.LocalAxisA = def.BodyA.GetLocalVector(axis) |
| 170 | } |
| 171 | |
| 172 | func MakeB2WheelJoint(def *B2WheelJointDef) *B2WheelJoint { |
| 173 | res := B2WheelJoint{ |
nothing calls this directly
no test coverage detected