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

Method Initialize

DynamicsB2JointWheel.go:164–170  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

162// J = [0 0 -1 0 0 1]
163
164func (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
172func MakeB2WheelJoint(def *B2WheelJointDef) *B2WheelJoint {
173 res := B2WheelJoint{

Callers

nothing calls this directly

Calls 2

GetLocalPointMethod · 0.80
GetLocalVectorMethod · 0.80

Tested by

no test coverage detected