Box2D::b2RevoluteJoint - Constrains two bodies to share a common point.
my $joint = $world->CreateJoint( $joint_def ); $joint->EnableMotor( 1 ); $joint->SetMaxMotorTorque( $torque ); $joint->SetMotorSpeed( $speed );
A revolute joint constrains two bodies to share a common point while they are free to rotate about the point. The relative rotation about the shared point is the joint angle. You can limit the relative rotation with a joint limit that specifies a lower and upper angle. You can use a motor to drive the relative rotation about the shared point. A maximum motor torque is provided so that infinite forces are not generated.
Enable/disable the joint limit.
Parameters:
bool $flag
bool
$flag
Enable/disable the joint motor.
Get the anchor point on bodyA in world coordinates. Implements Box2D::b2Joint.
Box2D::b2Joint
Returns a Box2D::b2Vec2
Box2D::b2Vec2
Get the anchor point on bodyB in world coordinates. Implements Box2D::b2Joint.
Get the current joint angle in radians.
Returns a float32
float32
Get the current joint angle speed in radians per second.
Get the lower joint limit in radians.
Get the motor speed in radians per second.
Get the current motor torque, usually in N-m.
Get the reaction force on body2 at the joint anchor in Newtons. Implements Box2D::b2Joint.
float32 $inv_dt
$inv_dt
Get the reaction torque on body2 in N*m. Implements Box2D::b2Joint.
Get the upper joint limit in radians.
Is the joint limit enabled?
Returns a bool
Is the joint motor enabled?
Set the joint limits in radians.
float32 $lower
$lower
float32 $upper
$upper
Set the maximum motor torque, usually in N-m.
float32 $torque
$torque
Set the motor speed in radians per second.
float32 $speed
$speed
Box2D
Box2D::b2RevoluteJointDef
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.