DistanceJointDef class

The data needed to construct a DistanceJoint.

Mirrors the native b2DistanceJointDef, with the native defaults.

Inheritance

Constructors

DistanceJointDef({required Body bodyA, required Body bodyB, Vector2? localAnchorA, Vector2? localAnchorB, double length = 1, bool enableSpring = false, double hertz = 0, double dampingRatio = 0, bool enableLimit = false, double minLength = 0, double maxLength = huge, bool enableMotor = false, double maxMotorForce = 0, double motorSpeed = 0, bool collideConnected = false, Object? userData})
Creates a distance joint definition.

Properties

bodyA ↔ Body
The first attached body.
getter/setter pairinherited
bodyB ↔ Body
The second attached body.
getter/setter pairinherited
collideConnected ↔ bool
Whether the connected bodies may collide with each other.
getter/setter pairinherited
dampingRatio ↔ double
The spring damping ratio, non-dimensional.
getter/setter pair
enableLimit ↔ bool
Whether the length limit is enabled; only used with the spring.
getter/setter pair
enableMotor ↔ bool
Whether the motor is enabled.
getter/setter pair
enableSpring ↔ bool
Whether the spring is enabled; when false the joint is rigid.
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
hertz ↔ double
The spring stiffness in hertz.
getter/setter pair
length ↔ double
The rest length of the joint, clamped to a stable minimum.
getter/setter pair
localAnchorA ↔ Vector2
The anchor point on the first body, in its local coordinates.
getter/setter pair
localAnchorB ↔ Vector2
The anchor point on the second body, in its local coordinates.
getter/setter pair
maxLength ↔ double
The maximum length of the joint.
getter/setter pair
maxMotorForce ↔ double
The maximum motor force, in newtons.
getter/setter pair
minLength ↔ double
The minimum length of the joint.
getter/setter pair
motorSpeed ↔ double
The motor speed, in meters per second.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
userData ↔ Object?
An arbitrary object associated with the joint.
getter/setter pairinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Constants

huge → const double
The native B2_HUGE constant, the default maximum length.