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 enableLimit #
enableLimit
bool enableMotor #
enableMotor
num lowerAngle #
lowerAngle
num maxMotorTorque #
maxMotorTorque
num motorSpeed #
motorSpeed
num referenceAngle #
referenceAngle
num upperAngle #
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; }