b2DistanceJointDef Class
Distance joint definition. This requires defining an anchor point on both bodies and the non-zero length of the distance joint. The definition uses local anchor points so that the initial configuration can violate the constraint slightly. This helps when saving and loading a game.
Warning: Do not use a zero or short length.
Constructor
b2DistanceJointDef
()
Item Index
Methods
Methods
initialize
(
Void
public
-
bodyA
-
bodyB
-
anchor1
-
anchor2
Parameters:
-
bodyA
B2Body -
bodyB
B2Body -
anchor1
B2Vec2 -
anchor2
B2Vec2
Returns:
Void:
Properties
dampingRatio
Float
public
The damping ratio. 0 = no damping, 1 = critical damping.
Default: 0.0
frequencyHz
Float
public
The mass-spring-damper frequency in Hertz. A value of 0 disables softness.
Default: 0.0
length
Float
public
The natural length between the anchor points.
Default: 1.0
localAnchorA
B2Vec2
public
The local anchor point relative to bodyA's origin.
localAnchorB
B2Vec2
public
The local anchor point relative to bodyB's origin.
type
Int
public
Default: b2Joint.e_distanceJoint