public static class RotationController.P extends RotationController
RotationController.D, RotationController.P, RotationController.PD| Modifier and Type | Field and Description |
|---|---|
private java.lang.Number |
angle
the setpoint
|
private java.lang.Number |
gain
the gain
|
private com.badlogic.gdx.math.Vector2 |
target
the point to rotate towards (may be null)
|
defaultUserDataAccessor| Constructor and Description |
|---|
P(java.lang.Number gain,
java.lang.Number angle) |
P(java.lang.Number gain,
java.lang.Number angle,
com.badlogic.gdx.math.Vector2 target) |
P(java.lang.Number gain,
com.badlogic.gdx.math.Vector2 target) |
| Modifier and Type | Method and Description |
|---|---|
static float |
calculateTargetAngle(com.badlogic.gdx.physics.box2d.Body body,
com.badlogic.gdx.math.Vector2 target) |
float |
calculateTorque(com.badlogic.gdx.physics.box2d.Body body) |
static float |
calculateTorque(float gain,
float rotation,
float target) |
java.lang.Number |
getAngle() |
java.lang.Number |
getGain() |
com.badlogic.gdx.math.Vector2 |
getTarget() |
void |
setAngle(java.lang.Number angle) |
void |
setGain(java.lang.Number gain) |
void |
setTarget(com.badlogic.gdx.math.Vector2 target) |
applyTorque, applyTorque, getUserDataAccessor, setUserDataAccessorprivate java.lang.Number gain
private java.lang.Number angle
private com.badlogic.gdx.math.Vector2 target
public P(java.lang.Number gain,
java.lang.Number angle)
public P(java.lang.Number gain,
com.badlogic.gdx.math.Vector2 target)
public static float calculateTorque(float gain,
float rotation,
float target)
gain - the gainrotation - the current rotationtarget - the setpointpublic static float calculateTargetAngle(com.badlogic.gdx.physics.box2d.Body body,
com.badlogic.gdx.math.Vector2 target)
body - the Body to rotatetarget - The point to rotate towards. May be null in which case zero is returned.public float calculateTorque(com.badlogic.gdx.physics.box2d.Body body)
calculateTorque in class RotationControllerpublic java.lang.Number getGain()
gainpublic void setGain(java.lang.Number gain)
gain - the gain to setpublic java.lang.Number getAngle()
anglepublic void setAngle(java.lang.Number angle)
angle - the angle to setpublic com.badlogic.gdx.math.Vector2 getTarget()
targetpublic void setTarget(com.badlogic.gdx.math.Vector2 target)
target - the target to set