++ed by:
GARU

1 PAUSE user(s)
1 non-PAUSE user(s).

Jeffrey T. Palmer
and 1 contributors

NAME

Box2D::b2DistanceJointDef - Distance joint definition.

SYNOPSIS

  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 );

DESCRIPTION

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.

METHODS

new()

Default constructor.

Returns a Box2D::b2DistanceJointDef

Initialize( $bodyA, $bodyB, $anchorA, $anchorB )

Initialize the bodies, anchors, and length using the world anchors.

Parameters:

  • Box2D::b2Body $bodyA

  • Box2D::b2Body $bodyB

  • Box2D::b2Vec2 $anchorA

  • Box2D::b2Vec2 $anchorB

dampingRatio()

dampingRatio( $dampingRatio )

The damping ratio. 0 = no damping, 1 = critical damping.

Parameters:

  • float32 $dampingRatio (optional)

Returns a float32

frequencyHz()

frequencyHz( $frequencyHz )

The mass-spring-damper frequency in Hertz.

Parameters:

  • float32 $frequencyHz (optional)

Returns a float32

length()

length( $length )

The natural length between the anchor points.

Parameters:

  • float32 $length (optional)

Returns a float32

localAnchorA()

localAnchorA( $localAnchorA )

The local anchor point relative to body1's origin.

Parameters:

  • Box2D::b2Vec2 $localAnchorA (optional)

Returns a Box2D::b2Vec2

localAnchorB()

localAnchorB( $localAnchorB )

The local anchor point relative to body2's origin.

Parameters:

  • Box2D::b2Vec2 $localAnchorB (optional)

Returns a Box2D::b2Vec2

SEE ALSO

BUGS

See "BUGS" in Box2D

AUTHORS

See "AUTHORS" in Box2D

COPYRIGHT & LICENSE

See "COPYRIGHT & LICENSE" in Box2D