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
a proportional-derivative controller
- Since:
- 0.11.1
- See Also:
-
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic floatcalculateTorque(float gainP, float gainD, float rotation, float target, float vel) floatcalculateTorque(com.badlogic.gdx.physics.box2d.Body body) getAngle()getGainD()getGainP()com.badlogic.gdx.math.Vector2voidvoidvoidvoidsetTarget(com.badlogic.gdx.math.Vector2 target) Methods inherited from class net.dermetfan.gdx.physics.box2d.RotationController
applyTorque, applyTorque, getUserDataAccessor, setUserDataAccessor
-
Constructor Details
-
PD
- Parameters:
gainP- thegainPgainD- thegainDangle- theangle
-
PD
- Parameters:
gainP- thegainPgainD- thegainDtarget- thetarget
-
PD
- Parameters:
gainP- thegainPgainD- thegainDangle- theangletarget- thetarget
-
-
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:
calculateTorquein classRotationController- Returns:
- the torque to apply
-
getGainP
- Returns:
- the
gainP
-
setGainP
- Parameters:
gainP- thegainPto set
-
getGainD
- Returns:
- the
gainD
-
setGainD
- Parameters:
gainD- thegainDto set
-
getAngle
- Returns:
- the
angle
-
setAngle
- 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
-