Class RotationController.PD

java.lang.Object
net.dermetfan.gdx.physics.box2d.RotationController
net.dermetfan.gdx.physics.box2d.RotationController.PD
Enclosing class:
RotationController

public static class RotationController.PD extends RotationController
a proportional-derivative controller
Since:
0.11.1
See Also:
  • Constructor Details

    • PD

      public PD(Number gainP, Number gainD, Number angle)
      Parameters:
      gainP - the gainP
      gainD - the gainD
      angle - the angle
    • PD

      public PD(Number gainP, Number gainD, com.badlogic.gdx.math.Vector2 target)
      Parameters:
      gainP - the gainP
      gainD - the gainD
      target - the target
    • PD

      public PD(Number gainP, Number gainD, Number angle, com.badlogic.gdx.math.Vector2 target)
      Parameters:
      gainP - the gainP
      gainD - the gainD
      angle - the angle
      target - the target
  • Method Details

    • calculateTorque

      public static float calculateTorque(float gainP, float gainD, float rotation, float target, float vel)
      See Also:
    • calculateTorque

      public float calculateTorque(com.badlogic.gdx.physics.box2d.Body body)
      Specified by:
      calculateTorque in class RotationController
      Returns:
      the torque to apply
    • getGainP

      public Number getGainP()
      Returns:
      the gainP
    • setGainP

      public void setGainP(Number gainP)
      Parameters:
      gainP - the gainP to set
    • getGainD

      public Number getGainD()
      Returns:
      the gainD
    • setGainD

      public void setGainD(Number gainD)
      Parameters:
      gainD - the gainD to set
    • getAngle

      public Number getAngle()
      Returns:
      the angle
    • setAngle

      public void setAngle(Number angle)
      Parameters:
      angle - the angle to set
    • getTarget

      public com.badlogic.gdx.math.Vector2 getTarget()
      Returns:
      the target
    • setTarget

      public void setTarget(com.badlogic.gdx.math.Vector2 target)
      Parameters:
      target - the target to set