Interface Mountable

All Known Implementing Classes:
ArmSim, LinearSim, RollerSim

public interface Mountable
Mixin interface for a simulated component that attaches to a Mount. The default helpers place the component on the canvas from the parent mount's type, position, and angle.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    The mount and starting geometry a mounted sim config carries.
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    getAngleOffset(double initialX, double initialY, double mountX, double mountY, double startingAngle)
    Angle of a component's initial position relative to its mount, measured off the mount's starting angle.
    static double
    getDistance(double x1, double y1, double x2, double y2)
    Straight-line distance between two canvas points, in metres.
    default double
    getUpdatedX(Mount.MountType mountType, double initialX, double initialY, double initMountX, double initMountY, double initMountAngle, double mountX, double mountY, double displacementX, double displacementY, double mountAngle)
    Full-geometry placement.
    default double
    Placement using the geometry a mounted sim config carries.
    default double
    getUpdatedY(Mount.MountType mountType, double initialX, double initialY, double initMountX, double initMountY, double initMountAngle, double mountX, double mountY, double displacementX, double displacementY, double mountAngle)
    Full-geometry placement.
    default double
    Placement using the geometry a mounted sim config carries.
    static double
    getXWithAngle(double radius, double angle, double displacementX)
    Cartesian X of a point radius from the reference point, angle radians off the Y axis.
    static double
    getYWithAngle(double radius, double angle, double displacementY)
    Cartesian Y of a point radius from the reference point, angle radians off the X axis.
  • Method Details

    • getUpdatedX

      default double getUpdatedX(Mount.MountType mountType, double initialX, double initialY, double initMountX, double initMountY, double initMountAngle, double mountX, double mountY, double displacementX, double displacementY, double mountAngle)
      Full-geometry placement. The Mountable.MountedConfig overloads pass a config's values straight through to this. All lengths are in metres and angles in radians.
      Returns:
      updated X position of the component on the canvas
    • getUpdatedY

      default double getUpdatedY(Mount.MountType mountType, double initialX, double initialY, double initMountX, double initMountY, double initMountAngle, double mountX, double mountY, double displacementX, double displacementY, double mountAngle)
      Full-geometry placement. The Mountable.MountedConfig overloads pass a config's values straight through to this. All lengths are in metres and angles in radians.
      Returns:
      updated Y position of the component on the canvas
    • getUpdatedX

      default double getUpdatedX(Mountable.MountedConfig config)
      Placement using the geometry a mounted sim config carries.
      Returns:
      updated X position on the canvas, in metres
    • getUpdatedY

      default double getUpdatedY(Mountable.MountedConfig config)
      Placement using the geometry a mounted sim config carries.
      Returns:
      updated Y position on the canvas, in metres
    • getAngleOffset

      static double getAngleOffset(double initialX, double initialY, double mountX, double mountY, double startingAngle)
      Angle of a component's initial position relative to its mount, measured off the mount's starting angle. A component left of the mount takes the mirrored branch.
    • getDistance

      static double getDistance(double x1, double y1, double x2, double y2)
      Straight-line distance between two canvas points, in metres.
    • getXWithAngle

      static double getXWithAngle(double radius, double angle, double displacementX)
      Cartesian X of a point radius from the reference point, angle radians off the Y axis. Lengths are in metres.
    • getYWithAngle

      static double getYWithAngle(double radius, double angle, double displacementY)
      Cartesian Y of a point radius from the reference point, angle radians off the X axis. Lengths are in metres.