WheelJointDef

data class WheelJointDef(val bodyA: Body, val bodyB: Body, val localAnchorA: Vec2 = Vec2.Zero, val localAnchorB: Vec2 = Vec2.Zero, val localAxisA: Vec2 = Vec2(0f, 1f), val enableSpring: Boolean = true, val hertz: Float = 1.0f, val dampingRatio: Float = 0.7f, val enableLimit: Boolean = false, val lowerTranslation: Float = 0.0f, val upperTranslation: Float = 0.0f, val enableMotor: Boolean = false, val maxMotorTorque: Float = 0.0f, val motorSpeed: Float = 0.0f, val collideConnected: Boolean = false)

Wheel joint definition.

A wheel joint allows for relative rotation between two bodies about a specified anchor point with a spring/damper suspension. It also allows for a linear constraint along a specified axis.

This is designed for vehicle suspensions.

Parameters

bodyA

The first attached body (usually the car chassis)

bodyB

The second attached body (usually the wheel)

localAnchorA

The local anchor point relative to bodyA's origin

localAnchorB

The local anchor point relative to bodyB's origin

localAxisA

The local translation unit axis in bodyA (suspension direction)

Constructors

Link copied to clipboard
constructor(bodyA: Body, bodyB: Body, localAnchorA: Vec2 = Vec2.Zero, localAnchorB: Vec2 = Vec2.Zero, localAxisA: Vec2 = Vec2(0f, 1f), enableSpring: Boolean = true, hertz: Float = 1.0f, dampingRatio: Float = 0.7f, enableLimit: Boolean = false, lowerTranslation: Float = 0.0f, upperTranslation: Float = 0.0f, enableMotor: Boolean = false, maxMotorTorque: Float = 0.0f, motorSpeed: Float = 0.0f, collideConnected: Boolean = false)

Properties

Link copied to clipboard
val bodyA: Body
Link copied to clipboard
val bodyB: Body
Link copied to clipboard

Set this flag to true if the attached bodies should collide

Link copied to clipboard

Spring damping ratio, non-dimensional

Link copied to clipboard

Enable the joint linear limit

Link copied to clipboard

Enable the joint rotational motor

Link copied to clipboard

Enable a linear spring along the local axis

Link copied to clipboard

Spring stiffness in Hertz

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The lower translation limit

Link copied to clipboard

The maximum motor torque, typically in newton-meters

Link copied to clipboard

The desired motor speed in radians per second

Link copied to clipboard

The upper translation limit