RevoluteJointDef class
class RevoluteJointDef extends JointDef { /** * The local anchor point relative to body1's origin. */ Vector localAnchorA; /** * The local anchor point relative to body2's origin. */ Vector localAnchorB; /** * The body2 angle minus body1 angle in the reference state (radians). */ num referenceAngle; /** * A flag to enable joint limits. */ bool enableLimit; /** * The lower angle for the joint limit (radians). */ num lowerAngle; /** * The upper angle for the joint limit (radians). */ num upperAngle; /** * A flag to enable the joint motor. */ bool enableMotor; /** * The desired motor speed. Usually in radians per second. */ num motorSpeed; /** * The maximum motor torque used to achieve the desired motor speed. * Usually in N-m. */ num maxMotorTorque; RevoluteJointDef() : super(), localAnchorA = new Vector(0.0, 0.0), localAnchorB = new Vector(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, Vector 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 Vector(0.0, 0.0), localAnchorB = new Vector(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;
bool enableLimit #
A flag to enable joint limits.
bool enableLimit;
bool enableMotor #
A flag to enable the joint motor.
bool enableMotor;
num lowerAngle #
The lower angle for the joint limit (radians).
num lowerAngle;
num maxMotorTorque #
The maximum motor torque used to achieve the desired motor speed. Usually in N-m.
num maxMotorTorque;
num motorSpeed #
The desired motor speed. Usually in radians per second.
num motorSpeed;
num referenceAngle #
The body2 angle minus body1 angle in the reference state (radians).
num referenceAngle;
int type #
inherited from JointDef
The joint type is set automatically for concrete joint types.
int type;
num upperAngle #
The upper angle for the joint limit (radians).
num upperAngle;
Methods
void initialize(Body b1, Body b2, Vector anchor) #
Initialize the bodies, anchors, and reference angle using the world anchor.
void initialize(Body b1, Body b2, Vector anchor) { bodyA = b1; bodyB = b2; bodyA.getLocalPointToOut(anchor, localAnchorA); bodyB.getLocalPointToOut(anchor, localAnchorB); referenceAngle = bodyA.angle - bodyB.angle; }