Joint

expect class Joint

Base class for all joints. A joint connects two bodies and constrains their relative motion.

Type-specific functions are prefixed with the joint type name. Calling a type-specific function on the wrong joint type will result in undefined behavior.

Properties

Link copied to clipboard

Get the current angular separation for this joint.

Link copied to clipboard
expect val bodyA: Body

Get body A on this joint.

Link copied to clipboard
expect val bodyB: Body

Get body B on this joint.

Link copied to clipboard

Whether connected bodies should collide.

Link copied to clipboard
expect val constraintForce: Vec2

Get the current constraint force for this joint, usually in Newtons.

Link copied to clipboard

Get the current constraint torque for this joint, usually in Newton-meters.

Link copied to clipboard
expect val isValid: Boolean

Check if this joint reference is valid. Joints may be destroyed by the user or during world destruction.

Link copied to clipboard

Get the current linear separation for this joint.

Link copied to clipboard
expect var localAnchorA: Vec2

The local anchor point on body A.

Link copied to clipboard
expect var localAnchorB: Vec2

The local anchor point on body B.

Link copied to clipboard
expect var localAxisA: Vec2

The local axis A for joints that use it (prismatic, wheel).

Link copied to clipboard
expect var referenceAngle: Float

The reference angle for joints that use it (revolute, prismatic, weld).

Link copied to clipboard
expect val type: JointType

The joint type.

Link copied to clipboard
expect var userData: Long

User data stored as a Long. Can be used as a key in a Map for associating arbitrary objects with this joint.

Link copied to clipboard
expect val world: World

Get the world that owns this joint.

Functions

Link copied to clipboard
expect fun distanceJointEnableLimit(enabled: Boolean)

Enable/disable the distance joint length limit.

Link copied to clipboard
expect fun distanceJointEnableMotor(enabled: Boolean)

Enable/disable the distance joint motor.

Link copied to clipboard
expect fun distanceJointEnableSpring(enabled: Boolean)

Enable/disable the distance joint spring.

Link copied to clipboard

Get the current distance joint length.

Link copied to clipboard

Get the rest length of a distance joint.

Link copied to clipboard

Get the distance joint maximum length.

Link copied to clipboard

Get the distance joint maximum motor force, usually in Newtons.

Link copied to clipboard

Get the distance joint minimum length.

Link copied to clipboard

Get the distance joint current motor force, usually in Newtons.

Link copied to clipboard

Get the distance joint motor speed, usually in meters per second.

Link copied to clipboard

Get the distance joint spring damping ratio (dimensionless).

Link copied to clipboard

Get the distance joint spring stiffness in Hertz.

Link copied to clipboard

Is the distance joint length limit enabled?

Link copied to clipboard

Is the distance joint motor enabled?

Link copied to clipboard

Is the distance joint spring enabled?

Link copied to clipboard
expect fun distanceJointSetLength(length: Float)

Set the rest length of a distance joint.

Link copied to clipboard
expect fun distanceJointSetLengthRange(minLength: Float, maxLength: Float)

Set the distance joint length range minLength, maxLength.

Link copied to clipboard

Set the distance joint maximum motor force, usually in Newtons.

Link copied to clipboard
expect fun distanceJointSetMotorSpeed(motorSpeed: Float)

Set the distance joint motor speed, usually in meters per second.

Link copied to clipboard
expect fun distanceJointSetSpringDampingRatio(dampingRatio: Float)

Set the distance joint spring damping ratio (dimensionless).

Link copied to clipboard

Set the distance joint spring stiffness in Hertz.

Link copied to clipboard

Get the constraint tuning for this joint.

Link copied to clipboard

Get the motor joint angular offset target in radians.

Link copied to clipboard

Get the motor joint correction factor, usually in 0, 1.

Link copied to clipboard

Get the motor joint linear offset target.

Link copied to clipboard

Get the motor joint maximum force, usually in Newtons.

Link copied to clipboard

Get the motor joint maximum torque, usually in Newton-meters.

Link copied to clipboard
expect fun motorJointSetAngularOffset(angularOffset: Float)

Set the motor joint angular offset target in radians.

Link copied to clipboard
expect fun motorJointSetCorrectionFactor(correctionFactor: Float)

Set the motor joint correction factor, usually in 0, 1.

Link copied to clipboard
expect fun motorJointSetLinearOffset(offset: Vec2)

Set the motor joint linear offset target.

Link copied to clipboard
expect fun motorJointSetMaxForce(maxForce: Float)

Set the motor joint maximum force, usually in Newtons.

Link copied to clipboard
expect fun motorJointSetMaxTorque(maxTorque: Float)

Set the motor joint maximum torque, usually in Newton-meters.

Link copied to clipboard

Get the mouse joint maximum force, usually in Newtons.

Link copied to clipboard

Get the mouse joint spring damping ratio (dimensionless).

Link copied to clipboard

Get the mouse joint spring stiffness in Hertz.

Link copied to clipboard

Get the mouse joint target.

Link copied to clipboard
expect fun mouseJointSetMaxForce(maxForce: Float)

Set the mouse joint maximum force, usually in Newtons.

Link copied to clipboard
expect fun mouseJointSetSpringDampingRatio(dampingRatio: Float)

Set the mouse joint spring damping ratio (dimensionless).

Link copied to clipboard
expect fun mouseJointSetSpringHertz(hertz: Float)

Set the mouse joint spring stiffness in Hertz.

Link copied to clipboard
expect fun mouseJointSetTarget(target: Vec2)

Set the mouse joint target.

Link copied to clipboard
expect fun prismaticJointEnableLimit(enabled: Boolean)

Enable/disable the prismatic joint limit.

Link copied to clipboard
expect fun prismaticJointEnableMotor(enabled: Boolean)

Enable/disable the prismatic joint motor.

Link copied to clipboard
expect fun prismaticJointEnableSpring(enabled: Boolean)

Enable/disable the prismatic joint spring.

Link copied to clipboard

Get the prismatic joint lower limit.

Link copied to clipboard

Get the prismatic joint maximum motor force, usually in Newtons.

Link copied to clipboard

Get the prismatic joint current motor force, usually in Newtons.

Link copied to clipboard

Get the prismatic joint motor speed, usually in meters per second.

Link copied to clipboard

Get the current prismatic joint speed.

Link copied to clipboard

Get the prismatic joint spring damping ratio (dimensionless).

Link copied to clipboard

Get the prismatic joint spring stiffness in Hertz.

Link copied to clipboard

Get the prismatic joint target translation.

Link copied to clipboard

Get the current prismatic joint translation.

Link copied to clipboard

Get the prismatic joint upper limit.

Link copied to clipboard

Is the prismatic joint limit enabled?

Link copied to clipboard

Is the prismatic joint motor enabled?

Link copied to clipboard

Is the prismatic joint spring enabled?

Link copied to clipboard
expect fun prismaticJointSetLimits(lower: Float, upper: Float)

Set the prismatic joint limits.

Link copied to clipboard

Set the prismatic joint maximum motor force, usually in Newtons.

Link copied to clipboard
expect fun prismaticJointSetMotorSpeed(motorSpeed: Float)

Set the prismatic joint motor speed, usually in meters per second.

Link copied to clipboard
expect fun prismaticJointSetSpringDampingRatio(dampingRatio: Float)

Set the prismatic joint spring damping ratio (dimensionless).

Link copied to clipboard

Set the prismatic joint spring stiffness in Hertz.

Link copied to clipboard
expect fun prismaticJointSetTargetTranslation(translation: Float)

Set the prismatic joint target translation.

Link copied to clipboard
expect fun revoluteJointEnableLimit(enabled: Boolean)

Enable/disable the revolute joint limit.

Link copied to clipboard
expect fun revoluteJointEnableMotor(enabled: Boolean)

Enable/disable the revolute joint motor.

Link copied to clipboard
expect fun revoluteJointEnableSpring(enabled: Boolean)

Enable/disable the revolute joint spring.

Link copied to clipboard

Get the revolute joint current angle in radians.

Link copied to clipboard

Get the revolute joint lower limit in radians.

Link copied to clipboard

Get the revolute joint maximum motor torque, usually in Newton-meters.

Link copied to clipboard

Get the revolute joint motor speed in radians per second.

Link copied to clipboard

Get the revolute joint current motor torque, usually in Newton-meters.

Link copied to clipboard

Get the revolute joint spring damping ratio (dimensionless).

Link copied to clipboard

Get the revolute joint spring stiffness in Hertz.

Link copied to clipboard

Get the revolute joint target angle in radians.

Link copied to clipboard

Get the revolute joint upper limit in radians.

Link copied to clipboard

Is the revolute joint limit enabled?

Link copied to clipboard

Is the revolute joint motor enabled?

Link copied to clipboard

Is the revolute joint spring enabled?

Link copied to clipboard
expect fun revoluteJointSetLimits(lower: Float, upper: Float)

Set the revolute joint limits in radians.

Link copied to clipboard

Set the revolute joint maximum motor torque, usually in Newton-meters.

Link copied to clipboard
expect fun revoluteJointSetMotorSpeed(motorSpeed: Float)

Set the revolute joint motor speed in radians per second.

Link copied to clipboard
expect fun revoluteJointSetSpringDampingRatio(dampingRatio: Float)

Set the revolute joint spring damping ratio (dimensionless).

Link copied to clipboard

Set the revolute joint spring stiffness in Hertz.

Link copied to clipboard

Set the revolute joint target angle in radians.

Link copied to clipboard
expect fun setConstraintTuning(hertz: Float, dampingRatio: Float)

Set the constraint tuning for this joint.

Link copied to clipboard
expect fun wakeBodies()

Wake up the connected bodies.

Link copied to clipboard

Get the weld joint angular damping ratio (dimensionless).

Link copied to clipboard

Get the weld joint angular stiffness in Hertz.

Link copied to clipboard

Get the weld joint linear damping ratio (dimensionless).

Link copied to clipboard

Get the weld joint linear stiffness in Hertz.

Link copied to clipboard
expect fun weldJointSetAngularDampingRatio(dampingRatio: Float)

Set the weld joint angular damping ratio (dimensionless).

Link copied to clipboard
expect fun weldJointSetAngularHertz(hertz: Float)

Set the weld joint angular stiffness in Hertz. 0 is rigid.

Link copied to clipboard
expect fun weldJointSetLinearDampingRatio(dampingRatio: Float)

Set the weld joint linear damping ratio (dimensionless).

Link copied to clipboard
expect fun weldJointSetLinearHertz(hertz: Float)

Set the weld joint linear stiffness in Hertz. 0 is rigid.

Link copied to clipboard
expect fun wheelJointEnableLimit(enabled: Boolean)

Enable/disable the wheel joint limit.

Link copied to clipboard
expect fun wheelJointEnableMotor(enabled: Boolean)

Enable/disable the wheel joint motor.

Link copied to clipboard
expect fun wheelJointEnableSpring(enabled: Boolean)

Enable/disable the wheel joint spring.

Link copied to clipboard

Get the wheel joint lower limit.

Link copied to clipboard

Get the wheel joint maximum motor torque, usually in Newton-meters.

Link copied to clipboard

Get the wheel joint motor speed in radians per second.

Link copied to clipboard

Get the wheel joint current motor torque, usually in Newton-meters.

Link copied to clipboard

Get the wheel joint spring damping ratio (dimensionless).

Link copied to clipboard

Get the wheel joint spring stiffness in Hertz.

Link copied to clipboard

Get the wheel joint upper limit.

Link copied to clipboard

Is the wheel joint limit enabled?

Link copied to clipboard

Is the wheel joint motor enabled?

Link copied to clipboard

Is the wheel joint spring enabled?

Link copied to clipboard
expect fun wheelJointSetLimits(lower: Float, upper: Float)

Set the wheel joint limits.

Link copied to clipboard

Set the wheel joint maximum motor torque, usually in Newton-meters.

Link copied to clipboard
expect fun wheelJointSetMotorSpeed(motorSpeed: Float)

Set the wheel joint motor speed in radians per second.

Link copied to clipboard
expect fun wheelJointSetSpringDampingRatio(dampingRatio: Float)

Set the wheel joint spring damping ratio (dimensionless).

Link copied to clipboard
expect fun wheelJointSetSpringHertz(hertz: Float)

Set the wheel joint spring stiffness in Hertz.