MCPcopy Create free account
hub / github.com/cinder/Cinder / Initialize

Method Initialize

blocks/Box2D/src/Box2D/Dynamics/Joints/b2DistanceJoint.cpp:38–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36// = invMass1 + invI1 * cross(r1, u)^2 + invMass2 + invI2 * cross(r2, u)^2
37
38void b2DistanceJointDef::Initialize(b2Body* b1, b2Body* b2,
39 const b2Vec2& anchor1, const b2Vec2& anchor2)
40{
41 bodyA = b1;
42 bodyB = b2;
43 localAnchorA = bodyA->GetLocalPoint(anchor1);
44 localAnchorB = bodyB->GetLocalPoint(anchor2);
45 b2Vec2 d = anchor2 - anchor1;
46 length = d.Length();
47}
48
49b2DistanceJoint::b2DistanceJoint(const b2DistanceJointDef* def)
50: b2Joint(def)

Callers

nothing calls this directly

Calls 2

GetLocalPointMethod · 0.80
LengthMethod · 0.80

Tested by

no test coverage detected