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 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
- thegainP
gainD
- thegainD
angle
- theangle
-
PD
public PD(java.lang.Number gainP, java.lang.Number gainD, com.badlogic.gdx.math.Vector2 target)- Parameters:
gainP
- thegainP
gainD
- thegainD
target
- thetarget
-
PD
public PD(java.lang.Number gainP, java.lang.Number gainD, java.lang.Number angle, com.badlogic.gdx.math.Vector2 target)- Parameters:
gainP
- thegainP
gainD
- thegainD
angle
- theangle
target
- 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:
calculateTorque
in 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
- thegainP
to set
-
getGainD
public java.lang.Number getGainD()- Returns:
- the
gainD
-
setGainD
public void setGainD(java.lang.Number gainD)- Parameters:
gainD
- thegainD
to set
-
getAngle
public java.lang.Number getAngle()- Returns:
- the
angle
-
setAngle
public void setAngle(java.lang.Number angle)- Parameters:
angle
- theangle
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
- thetarget
to set
-