RevoluteJointDef class
class RevoluteJointDef extends JointDef { /** * The local anchor point relative to body1's origin. */ vec2 localAnchorA; /** * The local anchor point relative to body2's origin. */ vec2 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 vec2.zero(), localAnchorB = new vec2.zero(), 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, vec2 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 vec2.zero(), localAnchorB = new vec2.zero(), 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, vec2 anchor) #
Initialize the bodies, anchors, and reference angle using the world anchor.
void initialize(Body b1, Body b2, vec2 anchor) { bodyA = b1; bodyB = b2; bodyA.getLocalPointToOut(anchor, localAnchorA); bodyB.getLocalPointToOut(anchor, localAnchorB); referenceAngle = bodyA.angle - bodyB.angle; }