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

NAME

Box2D::b2MouseJoint - Make a point on a body track a specified point.

SYNOPSIS

  my $joint = $world->CreateJoint( $joint_def );
  $joint->SetTarget( $target );

DESCRIPTION

A mouse joint is used to make a point on a body track a specified world point. This a soft constraint with a maximum force. This allows the constraint to stretch and without applying huge forces.

NOTE: this joint is not documented in the manual because it was developed to be used in the testbed. If you want to learn how to use the mouse joint, look at the testbed.

METHODS

GetAnchorA()

Implements Box2D::b2Joint.

Returns a Box2D::b2Vec2

GetAnchorB()

Implements Box2D::b2Joint.

Returns a Box2D::b2Vec2

GetDampingRatio()

Returns a float32

GetFrequency()

Returns a float32

GetMaxForce()

Returns a float32

GetReactionForce( $inv_dt )

Implements Box2D::b2Joint.

Parameters:

  • float32 $inv_dt

Returns a Box2D::b2Vec2

GetReactionTorque( $inv_dt )

Implements Box2D::b2Joint.

Parameters:

  • float32 $inv_dt

Returns a float32

GetTarget()

Returns a Box2D::b2Vec2

SetDampingRatio( $ratio )

Set/get the damping ratio (dimensionless).

Parameters:

  • float32 $ratio

SetFrequency( $hz )

Set/get the frequency in Hertz.

Parameters:

  • float32 $hz

SetMaxForce( $force )

Set/get the maximum force in Newtons.

Parameters:

  • float32 $force

SetTarget( $target )

Use this to update the target point.

Parameters:

  • Box2D::b2Vec2 $target

SEE ALSO

BUGS

See "BUGS" in Box2D

AUTHORS

See "AUTHORS" in Box2D

COPYRIGHT & LICENSE

See "COPYRIGHT & LICENSE" in Box2D