Package net.dermetfan.gdx.physics.box2d
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 floatcalculateTorque(float gainP, float gainD, float rotation, float target, float vel)floatcalculateTorque(com.badlogic.gdx.physics.box2d.Body body)java.lang.NumbergetAngle()java.lang.NumbergetGainD()java.lang.NumbergetGainP()com.badlogic.gdx.math.Vector2getTarget()voidsetAngle(java.lang.Number angle)voidsetGainD(java.lang.Number gainD)voidsetGainP(java.lang.Number gainP)voidsetTarget(com.badlogic.gdx.math.Vector2 target)Methods inherited from class net.dermetfan.gdx.physics.box2d.RotationController
applyTorque, applyTorque, getUserDataAccessor, setUserDataAccessorMethods 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- thegainPgainD- thegainDangle- theangle
-
PD
public PD(java.lang.Number gainP, java.lang.Number gainD, com.badlogic.gdx.math.Vector2 target)- Parameters:
gainP- thegainPgainD- thegainDtarget- thetarget
-
PD
public PD(java.lang.Number gainP, java.lang.Number gainD, java.lang.Number angle, com.badlogic.gdx.math.Vector2 target)- Parameters:
gainP- thegainPgainD- thegainDangle- theangletarget- thetarget
-
-
Method Details
-
calculateTorque
public static float calculateTorque(float gainP, float gainD, float rotation, float target, float vel) -
calculateTorque
public float calculateTorque(com.badlogic.gdx.physics.box2d.Body body)- Specified by:
calculateTorquein classRotationController- Returns:
- the torque to apply
-
getGainP
public java.lang.Number getGainP()- Returns:
- the
gainP
-
setGainP
public void setGainP(java.lang.Number gainP)- Parameters:
gainP- thegainPto set
-
getGainD
public java.lang.Number getGainD()- Returns:
- the
gainD
-
setGainD
public void setGainD(java.lang.Number gainD)- Parameters:
gainD- thegainDto set
-
getAngle
public java.lang.Number getAngle()- Returns:
- the
angle
-
setAngle
public void setAngle(java.lang.Number angle)- Parameters:
angle- theangleto set
-
getTarget
public com.badlogic.gdx.math.Vector2 getTarget()- Returns:
- the
target
-
setTarget
public void setTarget(com.badlogic.gdx.math.Vector2 target)- Parameters:
target- thetargetto set
-