core/math/ease

ease

Types

3

Ease

Ease :: enum int { Linear = 0, Quadratic_In = 1, Quadratic_Out = 2, Quadratic_In_Out = 3, Cubic_In = 4, Cubic_Out = 5, Cubic_In_Out = 6, Quartic_In = 7, Quartic_Out = 8, Quartic_In_Out = 9, Quintic_In = 10, Quintic_Out = 11, Quintic_In_Out = 12, Sine_In = 13, Sine_Out = 14, Sine_In_Out = 15, Circular_In = 16, Circular_Out = 17, Circular_In_Out = 18, Exponential_In = 19, Exponential_Out = 20, Exponential_In_Out = 21, Elastic_In = 22, Elastic_Out = 23, Elastic_In_Out = 24, Back_In = 25, Back_Out = 26, Back_In_Out = 27, Bounce_In = 28, Bounce_Out = 29, Bounce_In_Out = 30, }Source

additional enum variant

Procedures

61

back_in_out

back_in_out :: proc(p: T) -> (T)Source

Modeled after the piecewise overshooting cubic function: y = (1/2)((2x)^3-(2x)sin(2xpi)) ; [0, 0.5) y = (1/2)(1-((1-x)^3-(1-x)sin((1-x)*pi))+1) ; [0.5, 1]

circular_in_out

circular_in_out :: proc(p: T) -> (T)Source

Modeled after the piecewise circular function y = (1/2)(1 - sqrt(1 - 4x^2)) ; [0, 0.5) y = (1/2)(sqrt(-(2x - 3)*(2x - 1)) + 1) ; [0.5, 1]

elastic_in_out

elastic_in_out :: proc(p: T) -> (T)Source

Modeled after the piecewise exponentially-damped sine wave: y = (1/2)sin(13pi/2(2x))pow(2, 10 ((2x) - 1)) ; [0,0.5) y = (1/2)(sin(-13pi/2((2x-1)+1))pow(2,-10(2x-1)) + 2) ; [0.5, 1]

flux_init

flux_init :: proc(T: typeid, value_capacity: untyped integer = 8, allocator: mem.Allocator = context.allocator, loc = #caller_location) -> (Flux_Map($T=typeid))Source

init flux map to a float type and a wanted cap

flux_to

flux_to :: proc( flux: ^Flux_Map($T), value: ^T, goal: T, type: Ease, duration: time.Duration, delay: f64, ) -> (tween: ^Flux_Tween(T))Source

append / overwrite existing tween value to parameters rest is initialized in flux_tween_init, inside update return value can be used to set callbacks

flux_update

flux_update :: proc(flux: ^Flux_Map($T), dt: f64)Source

update all tweens, wait for their delay if one exists calls callbacks in all stages, when they're filled deletes tween from the map after completion

quadratic_in

quadratic_in :: proc(p: T) -> (T)Source

converted to odin from https://github.com/warrenm/AHEasing with additional enum based call Modeled after the parabola y = x^2

Reference search

Find anything

Documentation preferences

Settings

System theme variants

Used only while Theme is set to System.