Linear constraint (point-to-line) d = p2 - p1 = x2 + r2 - x1 - r1 C = dot(perp, d) Cdot = dot(d, cross(w1, perp)) + dot(perp, v2 + cross(w2, r2) - v1 - cross(w1, r1)) = -dot(perp, v1) - dot(cross(d + r1, perp), w1) + dot(perp, v2) + dot(cross(r2, perp), v2) J = [-perp, -cross(d + r1, perp), perp, cr
(bA *B2Body, bB *B2Body, anchor B2Vec2, axis B2Vec2)
| 199 | // df = f2 - f1 |
| 200 | |
| 201 | func (joint *B2PrismaticJointDef) Initialize(bA *B2Body, bB *B2Body, anchor B2Vec2, axis B2Vec2) { |
| 202 | joint.BodyA = bA |
| 203 | joint.BodyB = bB |
| 204 | joint.LocalAnchorA = joint.BodyA.GetLocalPoint(anchor) |
| 205 | joint.LocalAnchorB = joint.BodyB.GetLocalPoint(anchor) |
| 206 | joint.LocalAxisA = joint.BodyA.GetLocalVector(axis) |
| 207 | joint.ReferenceAngle = joint.BodyB.GetAngle() - joint.BodyA.GetAngle() |
| 208 | } |
| 209 | |
| 210 | func MakeB2PrismaticJoint(def *B2PrismaticJointDef) *B2PrismaticJoint { |
| 211 | res := B2PrismaticJoint{ |
nothing calls this directly
no test coverage detected