RevoluteJointDef class
class RevoluteJointDef extends JointDef { /** * The local anchor point relative to body1's origin. */ Vector2 localAnchorA; /** * The local anchor point relative to body2's origin. */ Vector2 localAnchorB; /** * The body2 angle minus body1 angle in the reference state (radians). */ double referenceAngle; /** * A flag to enable joint limits. */ bool enableLimit; /** * The lower angle for the joint limit (radians). */ double lowerAngle; /** * The upper angle for the joint limit (radians). */ double upperAngle; /** * A flag to enable the joint motor. */ bool enableMotor; /** * The desired motor speed. Usually in radians per second. */ double motorSpeed; /** * The maximum motor torque used to achieve the desired motor speed. * Usually in N-m. */ double maxMotorTorque; RevoluteJointDef() : super(), localAnchorA = new Vector2(0.0, 0.0), localAnchorB = new Vector2(0.0, 0.0), referenceAngle = 0.0, lowerAngle = 0.0, upperAngle = 0.0, maxMotorTorque = 0.0, motorSpeed = 0.0, enableLimit = false, enableMotor = false { type = JointType.REVOLUTE; } /** * Initialize the bodies, anchors, and reference angle using the world * anchor. */ void initialize(Body b1, Body b2, Vector2 anchor) { bodyA = b1; bodyB = b2; bodyA.getLocalPointToOut(anchor, localAnchorA); bodyB.getLocalPointToOut(anchor, localAnchorB); referenceAngle = bodyA.angle - bodyB.angle; } }
Extends
JointDef > RevoluteJointDef
Constructors
new RevoluteJointDef() #
RevoluteJointDef() : super(), localAnchorA = new Vector2(0.0, 0.0), localAnchorB = new Vector2(0.0, 0.0), referenceAngle = 0.0, lowerAngle = 0.0, upperAngle = 0.0, maxMotorTorque = 0.0, motorSpeed = 0.0, enableLimit = false, enableMotor = false { type = JointType.REVOLUTE; }
Properties
bool collideConnected #
inherited from JointDef
Set this flag to true if the attached bodies should collide.
bool collideConnected
double maxMotorTorque #
The maximum motor torque used to achieve the desired motor speed. Usually in N-m.
double maxMotorTorque
double referenceAngle #
The body2 angle minus body1 angle in the reference state (radians).
double referenceAngle
Methods
void initialize(Body b1, Body b2, Vector2 anchor) #
Initialize the bodies, anchors, and reference angle using the world anchor.
void initialize(Body b1, Body b2, Vector2 anchor) { bodyA = b1; bodyB = b2; bodyA.getLocalPointToOut(anchor, localAnchorA); bodyB.getLocalPointToOut(anchor, localAnchorB); referenceAngle = bodyA.angle - bodyB.angle; }