Box2D::b2RevoluteJointDef - Revolute joint definition.
my $joint_def = Box2D::b2RevoluteJointDef->new(); $joint_def->Initialize( $body_a, $body_b, $anchor ); my $joint = $world->CreateJoint( $joint_def );
Revolute joint definition. This requires defining an anchor point where the bodies are joined. The definition uses local anchor points so that the initial configuration can violate the constraint slightly. You also need to specify the initial relative angle for joint limits. This helps when saving and loading a game. The local anchor points are measured from the body's origin rather than the center of mass because:
Default constructor.
Returns a Box2D::b2RevoluteJointDef
Initialize the bodies, anchors, and reference angle using a world anchor point.
Parameters:
Box2D::b2Body
$bodyA
Box2D::b2Body
$bodyB
Box2D::b2Vec2
$anchor
A flag to enable joint limits.
Parameters:
bool
$enableLimit
(optional)Returns a bool
A flag to enable the joint motor.
Parameters:
bool
$enableMotor
(optional)Returns a bool
The local anchor point relative to body1's origin.
Parameters:
Box2D::b2Vec2
$localAnchorA
(optional)Returns a Box2D::b2Vec2
The local anchor point relative to body2's origin.
Parameters:
Box2D::b2Vec2
$localAnchorB
(optional)Returns a Box2D::b2Vec2
The lower angle for the joint limit (radians).
Parameters:
float32
$lowerAngle
(optional)Returns a float32
The maximum motor torque used to achieve the desired motor speed. Usually in N-m.
Parameters:
float32
$maxMotorTorque
(optional)Returns a float32
The desired motor speed. Usually in radians per second.
Parameters:
float32
$motorSpeed
(optional)Returns a float32
The body2 angle minus body1 angle in the reference state (radians).
Parameters:
float32
$referenceAngle
(optional)Returns a float32
The upper angle for the joint limit (radians).
Parameters:
float32
$upperAngle
(optional)Returns a float32
See "BUGS" in Box2D