Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: GearJoint

[19:7] extends: Joint

Wraps jbox2d's GearJoint (com.almasb.fxgl.physics.box2d.dynamics.joints.GearJoint). Connects two joints together with a gear ratio: coordinate1 + ratio * coordinate2 = constant. Each connected joint must be a revolute or prismatic joint and must attach a dynamic body to a static body (the static body is body1 on the source joint). Destroying joint1 or joint2 also requires destroying this gear joint manually.

Methods

  • GearJoint ()

    Empty default constructor; populated by adopt.

  • adopt (object Ajo)

    Wraps an existing GearJoint AussomJavaObject.

  • getRatio ()

    Returns the gear ratio.

  • setRatio (double Ratio)

    Sets the gear ratio.

  • getJoint1 ()

    Returns the first connected joint as a raw AJO. Caller may adopt it into the appropriate Joint subclass wrapper.

  • getJoint2 ()

    Returns the second connected joint as a raw AJO. Caller may adopt it into the appropriate Joint subclass wrapper.