Box2D::b2PrismaticJointDef - Prismatic joint definition.
my $joint_def = Box2D::b2PrismaticJointDef->new() $joint_def->Initialize( $body_a, $body_b, $anchor, $axis ); my $joint = $world->CreateJoint( $joint );
Prismatic joint definition. This requires defining a line of motion using an axis and an anchor point. The definition uses local anchor points and a local axis so that the initial configuration can violate the constraint slightly. The joint translation is zero when the local anchor points coincide in world space. Using local anchors and a local axis helps when saving and loading a game.
Warning: at least one body should by dynamic with a non-fixed rotation.
Default constructor.
Returns a Box2D::b2PrismaticJointDef
Box2D::b2PrismaticJointDef
Initialize the bodies, anchors, axis, and reference angle using the world anchor and world axis.
Parameters:
Box2D::b2Body $bodyA
Box2D::b2Body
$bodyA
Box2D::b2Body $bodyB
$bodyB
Box2D::b2Vec2 $anchor
Box2D::b2Vec2
$anchor
Box2D::b2Vec2 $axis
$axis
Enable/disable the joint limit.
bool $enableLimit (optional)
bool
$enableLimit
Returns a bool
Enable/disable the joint motor.
bool $enableMotor (optional)
$enableMotor
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
The local translation axis in body1.
Box2D::b2Vec2 $localAxis1 (optional)
$localAxis1
The lower translation limit, usually in meters.
float32 $lowerTranslation (optional)
float32
$lowerTranslation
Returns a float32
The maximum motor torque, usually in N-m.
float32 $maxMotorForce (optional)
$maxMotorForce
The desired motor speed in radians per second.
float32 $motorSpeed (optional)
$motorSpeed
The constrained angle between the bodies: body2_angle - body1_angle.
float32 $referenceAngle (optional)
$referenceAngle
The upper translation limit, usually in meters.
float32 $upperTranslation (optional)
$upperTranslation
Box2D
Box2D::b2PrismaticJoint
Box2D::b2JointDef
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.