Available since: Gideros 2011.6
Inherits from: b2.Joint
A distance joint constrains two points on two bodies to remain at a fixed distance from each other. You can view this as a massless, rigid rod.
local jointDef = b2.createDistanceJointDef(body1, body2, 100, 100, 200, 100) local distanceJoint = world:createJoint(jointDef) --by default length between two bodies is the length they have between them when joint was created --but it is possilbe to change it using distanceJoint:setLength(200) distanceJoint:setDampingRatio(0.5) distanceJoint:setFrequency(4)
b2.DistanceJoint:getDampingRatio returns the damping ratio