public class StopLogicEngine implements StopEngine


This contains the class to provide the logic for an animation to come to a stop. The setup defines a series of velocity gradients that gets to the desired position ending at 0 velocity. The path is computed such that the velocities are continuous

Summary

Nested types

public class StopLogicEngine.Decelerate implements StopEngine

Public constructors

Public methods

void
config(
    float currentPos,
    float destination,
    float currentVelocity,
    float maxTime,
    float maxAcceleration,
    float maxVelocity
)
String
debug(String desc, float time)

Debugging logic to log the state.

float
float
float
getVelocity(float x)
boolean

Public constructors

StopLogicEngine

Added in 1.1.0
public StopLogicEngine()

Public methods

config

Added in 1.1.0
public void config(
    float currentPos,
    float destination,
    float currentVelocity,
    float maxTime,
    float maxAcceleration,
    float maxVelocity
)

debug

Added in 1.1.0
public String debug(String desc, float time)

Debugging logic to log the state.

Parameters
String desc

Description to pre append

float time

Time during animation

Returns
String

string useful for debugging the state of the StopLogic

getInterpolation

Added in 1.1.0
public float getInterpolation(float v)

getVelocity

Added in 1.1.0
public float getVelocity()

getVelocity

Added in 1.1.0
public float getVelocity(float x)

isStopped

Added in 1.1.0
public boolean isStopped()