Jeffrey T. Palmer > Box2D > Box2D::b2DistanceJointDef

Download:
Box2D-0.07.tar.gz

Annotate this POD

View/Report Bugs
Source  

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:

dampingRatio()

dampingRatio( $dampingRatio )

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

Parameters:

Returns a float32

frequencyHz()

frequencyHz( $frequencyHz )

The mass-spring-damper frequency in Hertz.

Parameters:

Returns a float32

length()

length( $length )

The natural length between the anchor points.

Parameters:

Returns a float32

localAnchorA()

localAnchorA( $localAnchorA )

The local anchor point relative to body1's origin.

Parameters:

Returns a Box2D::b2Vec2

localAnchorB()

localAnchorB( $localAnchorB )

The local anchor point relative to body2's origin.

Parameters:

Returns a Box2D::b2Vec2

SEE ALSO ^

BUGS ^

See "BUGS" in Box2D

AUTHORS ^

See "AUTHORS" in Box2D

COPYRIGHT & LICENSE ^

See "COPYRIGHT & LICENSE" in Box2D

syntax highlighting: