T - Type of vector, either 2D or 3D, implementing the Vector interfacepublic class Evade<T extends com.badlogic.gdx.math.Vector<T>> extends Pursue<T>
Evade behavior is almost the same as Pursue except that the agent flees from the estimated future position of
the pursuer. Indeed, reversing the acceleration is all we have to do.maxPredictionTime, targetenabled, limiter, owner| Constructor and Description |
|---|
Evade(Steerable<T> owner,
Steerable<T> target)
Creates a
Evade behavior for the specified owner and target. |
Evade(Steerable<T> owner,
Steerable<T> target,
float maxPredictionTime)
Creates a
Evade behavior for the specified owner and pursuer. |
| Modifier and Type | Method and Description |
|---|---|
protected float |
getActualMaxLinearAcceleration()
Returns the actual linear acceleration to be applied.
|
Evade<T> |
setEnabled(boolean enabled)
Sets this steering behavior on/off.
|
Evade<T> |
setLimiter(Limiter limiter)
Sets the limiter of this steering behavior.
|
Evade<T> |
setOwner(Steerable<T> owner)
Sets the owner of this steering behavior.
|
Evade<T> |
setTarget(Steerable<T> target)
Sets the target.
|
calculateRealSteering, getMaxPredictionTime, getTarget, setMaxPredictionTimecalculateSteering, getActualLimiter, getLimiter, getOwner, isEnabled, newVectorpublic Evade(Steerable<T> owner, Steerable<T> target)
Evade behavior for the specified owner and target. Maximum prediction time defaults to 1 second.owner - the owner of this behaviortarget - the target of this behavior, typically a pursuer.public Evade(Steerable<T> owner, Steerable<T> target, float maxPredictionTime)
Evade behavior for the specified owner and pursuer.owner - the owner of this behaviortarget - the target of this behavior, typically a pursuermaxPredictionTime - the max time used to predict the pursuer's position assuming it continues to move with its current
velocity.protected float getActualMaxLinearAcceleration()
PursueEvade behavior to invert the
maximum linear acceleration in order to evade the target.getActualMaxLinearAcceleration in class Pursue<T extends com.badlogic.gdx.math.Vector<T>>public Evade<T> setOwner(Steerable<T> owner)
SteeringBehaviorpublic Evade<T> setEnabled(boolean enabled)
SteeringBehaviorsetEnabled in class Pursue<T extends com.badlogic.gdx.math.Vector<T>>public Evade<T> setLimiter(Limiter limiter)
setLimiter in class Pursue<T extends com.badlogic.gdx.math.Vector<T>>