retargetable_easers library

Classes

BumpPulse
DuoMovementSimulation
Forms a 2d simulation by just combining two Simulations in the x and y directions. Which is imperfect because instead of modelling an object that aims one thruster optimally, it's like it models an object with four thrusters pointing in cardinal directions, which is a weird object, but it looks fine, perhaps even better.
DynamicEaseInOutAnimationController
An animation controller that uses DynamicEaseInOut to allow smooth retargeting of animations. When the target value changes, the animation smoothly reorients without any discontinuities in velocity.
DynamicEaseInOutSimulation
A simulation that can be interrupted and reoriented with no discontinuities in velocity. Used in DynamicEaseInOutAnimationController, and SmoothV2
MovementSimulationAnimationController
An animation controller that can be told to target a position, and it smoothly moves to it
OffsetSimulation
regular Simulations target a one-dimensional number, this one targets a point in 2D space, though it's usually constructed by just taping together two Simulations in a DuoMovementSimulation
Pulser
PulserFold<T>
pulses to 1 and sags to 0. Is fairly graceful when interrupted, allowing pulses to overlap. T is a fold over the pulse
SmoothOffset
SmoothOffsetEaser

Functions

anti(double v) double
clampUnit(double v) double
constantAccelerationEaseInOutWithInitialVelocity(double t, double initialVelocity) double
defaultPulserFunction(double v) double
duoEaseMovementConstructorOf(Duration duration) MovementSimulationConstructor
basic movement constructors for your movement constructor needs
ease(double startValue, double endValue, double startTime, double endTime, double currentTime, double initialVelocity) double
easeOffset(Offset startValue, Offset endValue, double startTime, double endTime, double currentTime, Offset initialVelocity) Offset
easeValVel(double startValue, double endValue, double startTime, double endTime, double currentTime, double initialVelocity) → (double, double)
easeValVelOffset(Offset startValue, Offset endValue, double startTime, double endTime, double currentTime, Offset initialVelocity) → (Offset, Offset)
linearAccelerationEaseInOutWithInitialVelocity(double t, double initialVelocity) double
maxDuration(Duration a, Duration b) Duration
sq(double a) double
velEase(double startValue, double endValue, double startTime, double endTime, double currentTime, double initialVelocity) double
velocityOfConstantAccelerationEaseInOutWithInitialVelocity(double t, double initialVelocity) double
velocityOfLinearAccelerationEaseInOutWithInitialVelocity(double t, double initialVelocity) double

Typedefs

MovementSimulationConstructor = OffsetSimulation Function(Offset prevx, Offset prevdx, Offset newTarget)