public class WheelJointDef

  1. Object
  2. JointDef
  3. WheelJointDef
Wheel joint definition. This requires defining a line of motion using an axis and an anchor point. The definition uses local anchor points and a local axis so that the initial configuration can violate the constraint slightly. The joint translation is zero when the local anchor points coincide in world space. Using local anchors and a local axis helps when saving and loading a game.

Fields

public final Vec2 localAnchorAThe local anchor point relative to body1’s origin.
public final Vec2 localAnchorBThe local anchor point relative to body2’s origin.
public final Vec2 localAxisAThe local translation axis in body1.
public boolean enableMotorEnable/disable the joint motor.
public float maxMotorTorqueThe maximum motor torque, usually in N-m.
public float motorSpeedThe desired motor speed in radians per second.
public float frequencyHzSuspension frequency, zero indicates no suspension
public float dampingRatioSuspension damping ratio, one indicates critical damping

Constructors

public WheelJointDef()

Methods

public void initialize(Body b1, Body b2, Vec2 anchor, Vec2 axis)

Inherited fields

Inherited methods

Field details

localAnchorA

public final Vec2 localAnchorA
The local anchor point relative to body1’s origin.

localAnchorB

public final Vec2 localAnchorB
The local anchor point relative to body2’s origin.

localAxisA

public final Vec2 localAxisA
The local translation axis in body1.

enableMotor

public boolean enableMotor
Enable/disable the joint motor.

maxMotorTorque

public float maxMotorTorque
The maximum motor torque, usually in N-m.

motorSpeed

public float motorSpeed
The desired motor speed in radians per second.

frequencyHz

public float frequencyHz
Suspension frequency, zero indicates no suspension

dampingRatio

public float dampingRatio
Suspension damping ratio, one indicates critical damping

Constructor details

WheelJointDef

public WheelJointDef()

Method details

initialize

public void initialize(Body b1, Body b2, Vec2 anchor, Vec2 axis)