public static class PositionController.PD extends PositionController
PositionController.P,
PositionController.DPositionController.D, PositionController.P, PositionController.PD| Modifier and Type | Field and Description |
|---|---|
private com.badlogic.gdx.math.Vector2 |
destination
the setpoint
|
private com.badlogic.gdx.math.Vector2 |
gainD
the gain of the derivative component
|
private com.badlogic.gdx.math.Vector2 |
gainP
the gain of the proportional component
|
defaultUserDataAccessor, vec2| Constructor and Description |
|---|
PD(float gainP,
float gainD,
com.badlogic.gdx.math.Vector2 destination) |
PD(com.badlogic.gdx.math.Vector2 gainP,
com.badlogic.gdx.math.Vector2 gainD,
com.badlogic.gdx.math.Vector2 destination) |
| Modifier and Type | Method and Description |
|---|---|
com.badlogic.gdx.math.Vector2 |
calculateForce(com.badlogic.gdx.physics.box2d.Body body,
com.badlogic.gdx.math.Vector2 point) |
static float |
calculateForce(float gainP,
float gainD,
float pos,
float dest,
float vel) |
static com.badlogic.gdx.math.Vector2 |
calculateForce(float gainPX,
float gainPY,
float gainDX,
float gainDY,
float posX,
float posY,
float destX,
float destY,
float velX,
float velY) |
static com.badlogic.gdx.math.Vector2 |
calculateForce(com.badlogic.gdx.math.Vector2 gainP,
com.badlogic.gdx.math.Vector2 gainD,
com.badlogic.gdx.math.Vector2 pos,
com.badlogic.gdx.math.Vector2 dest,
com.badlogic.gdx.math.Vector2 vel) |
com.badlogic.gdx.math.Vector2 |
calculateForceToCenter(com.badlogic.gdx.physics.box2d.Body body) |
com.badlogic.gdx.math.Vector2 |
getDestination() |
com.badlogic.gdx.math.Vector2 |
getGainD() |
com.badlogic.gdx.math.Vector2 |
getGainP() |
void |
setDestination(com.badlogic.gdx.math.Vector2 destination) |
void |
setGainD(com.badlogic.gdx.math.Vector2 gainD) |
void |
setGainP(com.badlogic.gdx.math.Vector2 gainP) |
applyForce, applyForceToCenter, applyForceToCenter, getUserDataAccessor, setUserDataAccessorprivate com.badlogic.gdx.math.Vector2 gainP
private com.badlogic.gdx.math.Vector2 gainD
private com.badlogic.gdx.math.Vector2 destination
public PD(float gainP,
float gainD,
com.badlogic.gdx.math.Vector2 destination)
gainP - the proportional gain on both axesgainD - the derivative gain on both axesdestination - the destinationpublic PD(com.badlogic.gdx.math.Vector2 gainP,
com.badlogic.gdx.math.Vector2 gainD,
com.badlogic.gdx.math.Vector2 destination)
gainP - the gainPgainD - the gainDdestination - the destinationpublic static float calculateForce(float gainP,
float gainD,
float pos,
float dest,
float vel)
public static com.badlogic.gdx.math.Vector2 calculateForce(float gainPX,
float gainPY,
float gainDX,
float gainDY,
float posX,
float posY,
float destX,
float destY,
float velX,
float velY)
public static com.badlogic.gdx.math.Vector2 calculateForce(com.badlogic.gdx.math.Vector2 gainP,
com.badlogic.gdx.math.Vector2 gainD,
com.badlogic.gdx.math.Vector2 pos,
com.badlogic.gdx.math.Vector2 dest,
com.badlogic.gdx.math.Vector2 vel)
public com.badlogic.gdx.math.Vector2 calculateForce(com.badlogic.gdx.physics.box2d.Body body,
com.badlogic.gdx.math.Vector2 point)
calculateForce in class PositionControllerpoint - the world point at which the force should be appliedpublic com.badlogic.gdx.math.Vector2 calculateForceToCenter(com.badlogic.gdx.physics.box2d.Body body)
calculateForceToCenter in class PositionControllerpublic com.badlogic.gdx.math.Vector2 getGainP()
gainPpublic void setGainP(com.badlogic.gdx.math.Vector2 gainP)
gainP - the gainP to setpublic com.badlogic.gdx.math.Vector2 getGainD()
gainDpublic void setGainD(com.badlogic.gdx.math.Vector2 gainD)
gainD - the gainD to setpublic com.badlogic.gdx.math.Vector2 getDestination()
destinationpublic void setDestination(com.badlogic.gdx.math.Vector2 destination)
destination - the destination to set