MCPcopy Create free account
hub / github.com/ByteArena/box2d / Initialize

Method Initialize

DynamicsB2JointFriction.go:89–94  ·  view source on GitHub ↗

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) Angle constraint Cdot = w2 - w1 J = [0 0 -1 0 0 1] K = invI1 + invI2

(bA *B2Body, bB *B2Body, anchor B2Vec2)

Source from the content-addressed store, hash-verified

87// K = invI1 + invI2
88
89func (joint *B2FrictionJointDef) Initialize(bA *B2Body, bB *B2Body, anchor B2Vec2) {
90 joint.BodyA = bA
91 joint.BodyB = bB
92 joint.LocalAnchorA = joint.BodyA.GetLocalPoint(anchor)
93 joint.LocalAnchorB = joint.BodyB.GetLocalPoint(anchor)
94}
95
96func MakeB2FrictionJoint(def *B2FrictionJointDef) *B2FrictionJoint {
97 res := B2FrictionJoint{

Callers

nothing calls this directly

Calls 1

GetLocalPointMethod · 0.80

Tested by

no test coverage detected