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
Box2D::b2DistanceJointDef
Initialize the bodies, anchors, and length using the world anchors.
Parameters:
Box2D::b2Body $bodyA
Box2D::b2Body
$bodyA
Box2D::b2Body $bodyB
$bodyB
Box2D::b2Vec2 $anchorA
Box2D::b2Vec2
$anchorA
Box2D::b2Vec2 $anchorB
$anchorB
The damping ratio. 0 = no damping, 1 = critical damping.
float32 $dampingRatio (optional)
float32
$dampingRatio
Returns a float32
The mass-spring-damper frequency in Hertz.
float32 $frequencyHz (optional)
$frequencyHz
The natural length between the anchor points.
float32 $length (optional)
$length
The local anchor point relative to body1's origin.
Box2D::b2Vec2 $localAnchorA (optional)
$localAnchorA
Returns a Box2D::b2Vec2
The local anchor point relative to body2's origin.
Box2D::b2Vec2 $localAnchorB (optional)
$localAnchorB
Box2D
Box2D::b2JointDef
Box2D::b2DistanceJoint
Box2D::b2World
See "BUGS" in Box2D
See "AUTHORS" in Box2D
See "COPYRIGHT & LICENSE" in Box2D
To install Box2D, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Box2D
CPAN shell
perl -MCPAN -e shell install Box2D
For more information on module installation, please visit the detailed CPAN module installation guide.