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:
RotationController.P, RotationController.D
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.dermetfan.gdx.physics.box2d.RotationController

    RotationController.D, RotationController.P, RotationController.PD
  • Field Summary

    Fields inherited from class net.dermetfan.gdx.physics.box2d.RotationController

    defaultUserDataAccessor
  • Constructor Summary

    Constructors
    Constructor Description
    PD​(java.lang.Number gainP, java.lang.Number gainD, com.badlogic.gdx.math.Vector2 target)  
    PD​(java.lang.Number gainP, java.lang.Number gainD, java.lang.Number angle)  
    PD​(java.lang.Number gainP, java.lang.Number gainD, java.lang.Number angle, com.badlogic.gdx.math.Vector2 target)  
  • Method Summary

    Modifier and Type Method Description
    static float calculateTorque​(float gainP, float gainD, float rotation, float target, float vel)  
    float calculateTorque​(com.badlogic.gdx.physics.box2d.Body body)  
    java.lang.Number getAngle()  
    java.lang.Number getGainD()  
    java.lang.Number getGainP()  
    com.badlogic.gdx.math.Vector2 getTarget()  
    void setAngle​(java.lang.Number angle)  
    void setGainD​(java.lang.Number gainD)  
    void setGainP​(java.lang.Number gainP)  
    void setTarget​(com.badlogic.gdx.math.Vector2 target)  

    Methods inherited from class net.dermetfan.gdx.physics.box2d.RotationController

    applyTorque, applyTorque, getUserDataAccessor, setUserDataAccessor

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PD

      public PD​(java.lang.Number gainP, java.lang.Number gainD, java.lang.Number angle)
      Parameters:
      gainP - the gainP
      gainD - the gainD
      angle - the angle
    • PD

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

      public PD​(java.lang.Number gainP, java.lang.Number gainD, java.lang.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:
      RotationController.P.calculateTorque(float, float, float), RotationController.D.calculateTorque(float, float)
    • calculateTorque

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

      public java.lang.Number getGainP()
      Returns:
      the gainP
    • setGainP

      public void setGainP​(java.lang.Number gainP)
      Parameters:
      gainP - the gainP to set
    • getGainD

      public java.lang.Number getGainD()
      Returns:
      the gainD
    • setGainD

      public void setGainD​(java.lang.Number gainD)
      Parameters:
      gainD - the gainD to set
    • getAngle

      public java.lang.Number getAngle()
      Returns:
      the angle
    • setAngle

      public void setAngle​(java.lang.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