Class StopLogicEngine
- java.lang.Object
-
- androidx.constraintlayout.core.motion.utils.StopLogicEngine
-
- All Implemented Interfaces:
StopEngine
public class StopLogicEngine extends java.lang.Object 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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStopLogicEngine.Decelerate
-
Constructor Summary
Constructors Constructor Description StopLogicEngine()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfig(float currentPos, float destination, float currentVelocity, float maxTime, float maxAcceleration, float maxVelocity)java.lang.Stringdebug(java.lang.String desc, float time)Debugging logic to log the state.floatgetInterpolation(float v)floatgetVelocity()floatgetVelocity(float x)booleanisStopped()
-
-
-
Method Detail
-
debug
public java.lang.String debug(java.lang.String desc, float time)Debugging logic to log the state.- Specified by:
debugin interfaceStopEngine- Parameters:
desc- Description to pre appendtime- Time during animation- Returns:
- string useful for debugging the state of the StopLogic
-
getVelocity
public float getVelocity(float x)
- Specified by:
getVelocityin interfaceStopEngine
-
config
public void config(float currentPos, float destination, float currentVelocity, float maxTime, float maxAcceleration, float maxVelocity)
-
getInterpolation
public float getInterpolation(float v)
- Specified by:
getInterpolationin interfaceStopEngine
-
getVelocity
public float getVelocity()
- Specified by:
getVelocityin interfaceStopEngine
-
isStopped
public boolean isStopped()
- Specified by:
isStoppedin interfaceStopEngine
-
-