-
-
15 Apr 2018 06:15:26 UTC
- Distribution: Box2D
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Repository
- Issues (91)
- Testers (359 / 47 / 0)
- Kwalitee
Bus factor: 2- % Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (130.44KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- unknown
- Reverse dependencies
- CPAN Testers List
- Dependency graph
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
COPYRIGHT & LICENSE
Module Install Instructions
To install Box2D, copy and paste the appropriate command in to your terminal.
cpanm Box2D
perl -MCPAN -e shell install Box2D
For more information on module installation, please visit the detailed CPAN module installation guide.