
Box2D::b2DistanceJointDef - Distance joint definition.

my $joint_def = Box2D::b2DistanceJointDef->new(); $joint_def->Initialize( $body_a, $body_b, $anchor_a, $anchor_b ); $joint_def->length( $length ); my $joint = $world->CreateJoint( $joint_def );

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.

Default constructor.
Returns a Box2D::b2DistanceJointDef
Initialize the bodies, anchors, and length using the world anchors.
Parameters:
Box2D::b2Body $bodyABox2D::b2Body $bodyBBox2D::b2Vec2 $anchorABox2D::b2Vec2 $anchorBThe damping ratio. 0 = no damping, 1 = critical damping.
Parameters:
float32 $dampingRatio (optional)Returns a float32
The mass-spring-damper frequency in Hertz.
Parameters:
float32 $frequencyHz (optional)Returns a float32
The natural length between the anchor points.
Parameters:
float32 $length (optional)Returns a float32
The local anchor point relative to body1's origin.
Parameters:
Box2D::b2Vec2 $localAnchorA (optional)Returns a Box2D::b2Vec2
The local anchor point relative to body2's origin.
Parameters:
Box2D::b2Vec2 $localAnchorB (optional)Returns a Box2D::b2Vec2


See "BUGS" in Box2D

