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

Method Initialize

DynamicsB2JointWeld.go:123–129  ·  view source on GitHub ↗

Point-to-point constraint C = p2 - p1 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 C = angle2 - angle1 - referenceAngle 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

121// // K = invI1 + invI2
122
123func (def *B2WeldJointDef) Initialize(bA *B2Body, bB *B2Body, anchor B2Vec2) {
124 def.BodyA = bA
125 def.BodyB = bB
126 def.LocalAnchorA = def.BodyA.GetLocalPoint(anchor)
127 def.LocalAnchorB = def.BodyB.GetLocalPoint(anchor)
128 def.ReferenceAngle = def.BodyB.GetAngle() - def.BodyA.GetAngle()
129}
130
131func MakeB2WeldJoint(def *B2WeldJointDef) *B2WeldJoint {
132 res := B2WeldJoint{

Callers

nothing calls this directly

Calls 2

GetLocalPointMethod · 0.80
GetAngleMethod · 0.45

Tested by

no test coverage detected