The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

=head1 NAME

Box2D::b2RevoluteJointDef - Revolute joint definition.

=head1 SYNOPSIS

  my $joint_def = Box2D::b2RevoluteJointDef->new();
  $joint_def->Initialize( $body_a, $body_b, $anchor );
  my $joint = $world->CreateJoint( $joint_def );

=head1 DESCRIPTION

Revolute joint definition. This requires defining an anchor point where
the bodies are joined. The definition uses local anchor points so that
the initial configuration can violate the constraint slightly. You also
need to specify the initial relative angle for joint limits. This helps
when saving and loading a game. The local anchor points are measured
from the body's origin rather than the center of mass because:

=over 4

=item 1.

you might not know where the center of mass will be.

=item 2.

if you add/remove shapes from a body and recompute the mass, the joints
will be broken.

=back

=head1 METHODS

=head2 new()

Default constructor.

Returns a C<Box2D::b2RevoluteJointDef>

=head2 Initialize( $bodyA, $bodyB, $anchor )

Initialize the bodies, anchors, and reference angle using a world
anchor point.

Parameters:

=over 4

=item * C<Box2D::b2Body> C<$bodyA>

=item * C<Box2D::b2Body> C<$bodyB>

=item * C<Box2D::b2Vec2> C<$anchor>

=back

=head2 enableLimit()

=head2 enableLimit( $enableLimit )

A flag to enable joint limits.

Parameters:

=over 4

=item * C<bool> C<$enableLimit> (optional)

=back

Returns a C<bool>

=head2 enableMotor()

=head2 enableMotor( $enableMotor )

A flag to enable the joint motor.

Parameters:

=over 4

=item * C<bool> C<$enableMotor> (optional)

=back

Returns a C<bool>

=head2 localAnchorA()

=head2 localAnchorA( $localAnchorA )

The local anchor point relative to body1's origin.

Parameters:

=over 4

=item * C<Box2D::b2Vec2> C<$localAnchorA> (optional)

=back

Returns a C<Box2D::b2Vec2>

=head2 localAnchorB()

=head2 localAnchorB( $localAnchorB )

The local anchor point relative to body2's origin.

Parameters:

=over 4

=item * C<Box2D::b2Vec2> C<$localAnchorB> (optional)

=back

Returns a C<Box2D::b2Vec2>

=head2 lowerAngle()

=head2 lowerAngle( $lowerAngle )

The lower angle for the joint limit (radians).

Parameters:

=over 4

=item * C<float32> C<$lowerAngle> (optional)

=back

Returns a C<float32>

=head2 maxMotorTorque()

=head2 maxMotorTorque( $maxMotorTorque )

The maximum motor torque used to achieve the desired motor speed.
Usually in N-m.

Parameters:

=over 4

=item * C<float32> C<$maxMotorTorque> (optional)

=back

Returns a C<float32>

=head2 motorSpeed()

=head2 motorSpeed( $motorSpeed )

The desired motor speed. Usually in radians per second.

Parameters:

=over 4

=item * C<float32> C<$motorSpeed> (optional)

=back

Returns a C<float32>

=head2 referenceAngle()

=head2 referenceAngle( $referenceAngle )

The body2 angle minus body1 angle in the reference state (radians).

Parameters:

=over 4

=item * C<float32> C<$referenceAngle> (optional)

=back

Returns a C<float32>

=head2 upperAngle()

=head2 upperAngle( $upperAngle )

The upper angle for the joint limit (radians).

Parameters:

=over 4

=item * C<float32> C<$upperAngle> (optional)

=back

Returns a C<float32>

=head1 SEE ALSO

=over 4

=item * L<Box2D>

=item * L<Box2D::b2RevoluteJoint>

=item * L<Box2D::b2JointDef>

=item * L<Box2D::b2World>

=back

=head1 BUGS

See L<Box2D/BUGS>

=head1 AUTHORS

See L<Box2D/AUTHORS>

=head1 COPYRIGHT & LICENSE

See L<Box2D/"COPYRIGHT & LICENSE">

=cut