Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: WheelJoint

[18:7] extends: Joint

Wraps jbox2d's WheelJoint (com.almasb.fxgl.physics.box2d.dynamics.joints.WheelJoint). Provides two degrees of freedom: translation along an axis fixed in bodyA and rotation in the plane. Designed for vehicle suspensions, with optional rotational motor and a soft spring/damper on the suspension axis.

Methods

  • WheelJoint ()

    Empty default constructor; populated by adopt.

  • adopt (object Ajo)

    Wraps an existing WheelJoint AussomJavaObject.

  • getLocalAnchorA ()

    Returns the local anchor on body A as a Vec2 wrapper.

  • getLocalAnchorB ()

    Returns the local anchor on body B as a Vec2 wrapper.

  • getLocalAxisA ()

    Returns the local translation axis in body A as a Vec2 wrapper.

  • getJointTranslation ()

    Returns the current joint translation, usually in meters.

  • getJointSpeed ()

    Returns the current joint angular speed.

  • isMotorEnabled ()

    Returns whether the joint motor is enabled.

  • enableMotor (bool Flag)

    Enables or disables the joint motor.

  • setMotorSpeed (double Speed)

    Sets the motor speed, usually in radians per second.

  • getMotorSpeed ()

    Returns the motor speed, usually in radians per second.

  • getMaxMotorTorque ()

    Returns the maximum motor torque, usually in N*m.

  • setMaxMotorTorque (double Torque)

    Sets the maximum motor torque, usually in N*m.

  • getMotorTorque (double InvDt)

    Returns the current motor torque for the inverse dt.

  • setSpringFrequencyHz (double Hz)

    Sets the suspension spring frequency in Hertz.

  • getSpringFrequencyHz ()

    Returns the suspension spring frequency in Hertz.

  • setSpringDampingRatio (double Ratio)

    Sets the suspension damping ratio.

  • getSpringDampingRatio ()

    Returns the suspension damping ratio.