T - Type of vector, either 2D or 3D, implementing the Vector interfacepublic class Face<T extends com.badlogic.gdx.math.Vector<T>> extends ReachOrientation<T>
Face behavior makes the owner look at its target. It delegates to the ReachOrientation behavior to perform the
rotation but calculates the target orientation first based on target and owner position.alignTolerance, decelerationRadius, target, timeToTargetenabled, limiter, owner| Constructor and Description |
|---|
Face(Steerable<T> owner)
Creates a
Face behavior for the specified owner. |
Face(Steerable<T> owner,
Location<T> target)
Creates a
Face 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.
|
protected SteeringAcceleration<T> |
face(SteeringAcceleration<T> steering,
T targetPosition) |
Face<T> |
setAlignTolerance(float alignTolerance)
Sets the tolerance for aligning to the target without letting small errors keep the owner swinging.
|
Face<T> |
setDecelerationRadius(float decelerationRadius)
Sets the radius for beginning to slow down
|
Face<T> |
setEnabled(boolean enabled)
Sets this steering behavior on/off.
|
Face<T> |
setLimiter(Limiter limiter)
Sets the limiter of this steering behavior.
|
Face<T> |
setOwner(Steerable<T> owner)
Sets the owner of this steering behavior.
|
Face<T> |
setTarget(Location<T> target)
Sets the target to align to.
|
Face<T> |
setTimeToTarget(float timeToTarget)
Sets the time over which to achieve target rotation speed
|
getAlignTolerance, getDecelerationRadius, getTarget, getTimeToTarget, reachOrientationcalculateSteering, getActualLimiter, getLimiter, getOwner, isEnabled, newVectorpublic Face(Steerable<T> owner)
Face 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 ReachOrientation<T extends com.badlogic.gdx.math.Vector<T>>steering - the steering acceleration to be calculated.protected SteeringAcceleration<T> face(SteeringAcceleration<T> steering, T targetPosition)
public Face<T> setOwner(Steerable<T> owner)
SteeringBehaviorsetOwner in class ReachOrientation<T extends com.badlogic.gdx.math.Vector<T>>public Face<T> setEnabled(boolean enabled)
SteeringBehaviorsetEnabled in class ReachOrientation<T extends com.badlogic.gdx.math.Vector<T>>public Face<T> setLimiter(Limiter limiter)
setLimiter in class ReachOrientation<T extends com.badlogic.gdx.math.Vector<T>>public Face<T> setTarget(Location<T> target)
ReachOrientationsetTarget in class ReachOrientation<T extends com.badlogic.gdx.math.Vector<T>>public Face<T> setAlignTolerance(float alignTolerance)
ReachOrientationsetAlignTolerance in class ReachOrientation<T extends com.badlogic.gdx.math.Vector<T>>public Face<T> setDecelerationRadius(float decelerationRadius)
ReachOrientationsetDecelerationRadius in class ReachOrientation<T extends com.badlogic.gdx.math.Vector<T>>public Face<T> setTimeToTarget(float timeToTarget)
ReachOrientationsetTimeToTarget in class ReachOrientation<T extends com.badlogic.gdx.math.Vector<T>>