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

Method Initialize

DynamicsB2JointRevolute.go:146–152  ·  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) Motor 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

144// K = invI1 + invI2
145
146func (def *B2RevoluteJointDef) Initialize(bA *B2Body, bB *B2Body, anchor B2Vec2) {
147 def.BodyA = bA
148 def.BodyB = bB
149 def.LocalAnchorA = def.BodyA.GetLocalPoint(anchor)
150 def.LocalAnchorB = def.BodyB.GetLocalPoint(anchor)
151 def.ReferenceAngle = def.BodyB.GetAngle() - def.BodyA.GetAngle()
152}
153
154func MakeB2RevoluteJoint(def *B2RevoluteJointDef) *B2RevoluteJoint {
155 res := B2RevoluteJoint{

Callers

nothing calls this directly

Calls 2

GetLocalPointMethod · 0.80
GetAngleMethod · 0.45

Tested by

no test coverage detected