RevoluteJointDef<A extends Body, B extends Body> class

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:

  • You might not know where the center of mass will be.
  • If you add/remove shapes from a body and recompute the mass, the joints will be broken.




bodyA ↔ A
The first attached body.
getter/setter pairinherited
bodyB ↔ B
The second attached body.
getter/setter pairinherited
collideConnected bool
Set this flag to true if the attached bodies should collide.
getter/setter pairinherited
enableLimit bool
A flag to enable joint limits.
getter/setter pair
enableMotor bool
A flag to enable the joint motor.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
localAnchorA Vector2
The local anchor point relative to body1's origin.
localAnchorB Vector2
The local anchor point relative to body2's origin.
lowerAngle double
The lower angle for the joint limit (radians).
getter/setter pair
maxMotorTorque double
The maximum motor torque used to achieve the desired motor speed. Usually in N-m.
getter/setter pair
motorSpeed double
The desired motor speed. Usually in radians per second.
getter/setter pair
referenceAngle double
The body2 angle minus body1 angle in the reference state (radians).
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
upperAngle double
The upper angle for the joint limit (radians).
getter/setter pair
userData Object?
Use this to attach application specific data to your joints.
getter/setter pairinherited


initialize(A body1, B body2, Vector2 anchor) → void
Initialize the bodies, anchors, and reference angle using the world anchor.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
toString() String
A string representation of this object.


operator ==(Object other) bool
The equality operator.