public static class PositionController.P extends PositionController
PositionController.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 |
gain
the gain
|
defaultUserDataAccessor, vec2| Constructor and Description |
|---|
P(float gain,
com.badlogic.gdx.math.Vector2 destination) |
P(com.badlogic.gdx.math.Vector2 gain,
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 gain,
float pos,
float dest) |
static com.badlogic.gdx.math.Vector2 |
calculateForce(float gainX,
float gainY,
float x,
float y,
float destX,
float destY) |
static com.badlogic.gdx.math.Vector2 |
calculateForce(com.badlogic.gdx.math.Vector2 gain,
com.badlogic.gdx.math.Vector2 pos,
com.badlogic.gdx.math.Vector2 dest) |
com.badlogic.gdx.math.Vector2 |
calculateForceToCenter(com.badlogic.gdx.physics.box2d.Body body) |
com.badlogic.gdx.math.Vector2 |
getDestination() |
com.badlogic.gdx.math.Vector2 |
getGain() |
void |
setDestination(com.badlogic.gdx.math.Vector2 destination) |
void |
setGain(com.badlogic.gdx.math.Vector2 gain) |
applyForce, applyForceToCenter, applyForceToCenter, getUserDataAccessor, setUserDataAccessorprivate com.badlogic.gdx.math.Vector2 gain
private com.badlogic.gdx.math.Vector2 destination
public P(float gain,
com.badlogic.gdx.math.Vector2 destination)
gain - the gain on both axesdestination - the destinationpublic P(com.badlogic.gdx.math.Vector2 gain,
com.badlogic.gdx.math.Vector2 destination)
gain - the gaindestination - the destinationpublic static float calculateForce(float gain,
float pos,
float dest)
gain - the gainpos - the current positiondest - the setpointpublic static com.badlogic.gdx.math.Vector2 calculateForce(float gainX,
float gainY,
float x,
float y,
float destX,
float destY)
PositionController.vec2calculateForce(float, float, float)public static com.badlogic.gdx.math.Vector2 calculateForce(com.badlogic.gdx.math.Vector2 gain,
com.badlogic.gdx.math.Vector2 pos,
com.badlogic.gdx.math.Vector2 dest)
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 getGain()
gainpublic void setGain(com.badlogic.gdx.math.Vector2 gain)
gain - the gain to setpublic com.badlogic.gdx.math.Vector2 getDestination()
destinationpublic void setDestination(com.badlogic.gdx.math.Vector2 destination)
destination - the destination to set