T - Type of vector, either 2D or 3D, implementing the Vector interfacepublic class Seek<T extends com.badlogic.gdx.math.Vector<T>> extends SteeringBehavior<T>
Seek behavior moves the owner towards the target position. Given a target, this behavior calculates the linear steering
acceleration which will direct the agent towards the target as fast as possible.| Modifier and Type | Field and Description |
|---|---|
protected Location<T> |
target
The target to seek
|
enabled, limiter, owner| Constructor and Description |
|---|
Seek(Steerable<T> owner)
Creates a
Seek behavior for the specified owner. |
Seek(Steerable<T> owner,
Location<T> target)
Creates a
Seek behavior for the specified owner and target. |
| Modifier and Type | Method and Description |
|---|---|
protected SteeringAcceleration<T> |
calculateRealSteering(SteeringAcceleration<T> steering)
Calculates the steering acceleration produced by this behavior and writes it to the given steering output.
|
Location<T> |
getTarget()
Returns the target to seek.
|
Seek<T> |
setEnabled(boolean enabled)
Sets this steering behavior on/off.
|
Seek<T> |
setLimiter(Limiter limiter)
Sets the limiter of this steering behavior.
|
Seek<T> |
setOwner(Steerable<T> owner)
Sets the owner of this steering behavior.
|
Seek<T> |
setTarget(Location<T> target)
Sets the target to seek.
|
calculateSteering, getActualLimiter, getLimiter, getOwner, isEnabled, newVectorpublic Seek(Steerable<T> owner)
Seek behavior for the specified owner.owner - the owner of this behavior.protected SteeringAcceleration<T> calculateRealSteering(SteeringAcceleration<T> steering)
SteeringBehavior
This method is called by SteeringBehavior.calculateSteering(SteeringAcceleration) when this steering behavior is enabled.
calculateRealSteering in class SteeringBehavior<T extends com.badlogic.gdx.math.Vector<T>>steering - the steering acceleration to be calculated.public Seek<T> setTarget(Location<T> target)
public Seek<T> setOwner(Steerable<T> owner)
SteeringBehaviorsetOwner in class SteeringBehavior<T extends com.badlogic.gdx.math.Vector<T>>public Seek<T> setEnabled(boolean enabled)
SteeringBehaviorsetEnabled in class SteeringBehavior<T extends com.badlogic.gdx.math.Vector<T>>public Seek<T> setLimiter(Limiter limiter)
setLimiter in class SteeringBehavior<T extends com.badlogic.gdx.math.Vector<T>>