NAME
Box2D::b2PrismaticJointDef - Prismatic joint definition.
SYNOPSIS
my $joint_def = Box2D::b2PrismaticJointDef->new()
$joint_def->Initialize( $body_a, $body_b, $anchor, $axis );
my $joint = $world->CreateJoint( $joint );
DESCRIPTION
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.
METHODS
new()
Default constructor.
Returns a Box2D::b2PrismaticJointDef
Initialize( $bodyA, $bodyB, $anchor, $axis )
Initialize the bodies, anchors, axis, and reference angle using the world anchor and world axis.
Parameters:
Box2D::b2Body
$bodyA
Box2D::b2Body
$bodyB
Box2D::b2Vec2
$anchor
Box2D::b2Vec2
$axis
enableLimit()
enableLimit( $enableLimit )
Enable/disable the joint limit.
Parameters:
bool
$enableLimit
(optional)
Returns a bool
enableMotor()
enableMotor( $enableMotor )
Enable/disable the joint motor.
Parameters:
bool
$enableMotor
(optional)
Returns a bool
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
localAxis1()
localAxis1( $localAxis1 )
The local translation axis in body1.
Parameters:
Box2D::b2Vec2
$localAxis1
(optional)
Returns a Box2D::b2Vec2
lowerTranslation()
lowerTranslation( $lowerTranslation )
The lower translation limit, usually in meters.
Parameters:
float32
$lowerTranslation
(optional)
Returns a float32
maxMotorForce()
maxMotorForce( $maxMotorForce )
The maximum motor torque, usually in N-m.
Parameters:
float32
$maxMotorForce
(optional)
Returns a float32
motorSpeed()
motorSpeed( $motorSpeed )
The desired motor speed in radians per second.
Parameters:
float32
$motorSpeed
(optional)
Returns a float32
referenceAngle()
referenceAngle( $referenceAngle )
The constrained angle between the bodies: body2_angle - body1_angle.
Parameters:
float32
$referenceAngle
(optional)
Returns a float32
upperTranslation()
upperTranslation( $upperTranslation )
The upper translation limit, usually in meters.
Parameters:
float32
$upperTranslation
(optional)
Returns a float32
SEE ALSO
BUGS
See "BUGS" in Box2D