Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: MouseJoint

[17:7] extends: Joint

Wraps jbox2d's MouseJoint (com.almasb.fxgl.physics.box2d.dynamics.joints.MouseJoint). Makes a point on a body track a specified world point as a soft constraint with a maximum force, so it can stretch without applying huge forces. Typically used to drag bodies.

Methods

  • MouseJoint ()

    Empty default constructor; populated by adopt.

  • adopt (object Ajo)

    Wraps an existing MouseJoint AussomJavaObject.

  • getTarget ()

    Returns the current world-space target as a Vec2 wrapper.

  • setTarget (object TargetVec)

    Sets the world-space target the body should track.

  • getMaxForce ()

    Returns the maximum force in Newtons.

  • setMaxForce (double Force)

    Sets the maximum force in Newtons.

  • getFrequency ()

    Returns the response frequency in Hertz.

  • setFrequency (double Hz)

    Sets the response frequency in Hertz.

  • getDampingRatio ()

    Returns the damping ratio (0 = none, 1 = critical).

  • setDampingRatio (double Ratio)

    Sets the damping ratio (0 = none, 1 = critical).