package core:math/ease
Overview
easing procedures and flux easing used for animations
Index
Types (3)
Constants (0)
This section is empty.
Variables (0)
This section is empty.
Procedures (39)
- back_in
- back_in_out
- back_out
- bounce_in
- bounce_in_out
- bounce_out
- circular_in
- circular_in_out
- circular_out
- cubic_in
- cubic_in_out
- cubic_out
- ease
- elastic_in
- elastic_in_out
- elastic_out
- exponential_in
- exponential_in_out
- exponential_out
- flux_clear
- flux_destroy
- flux_init
- flux_stop
- flux_to
- flux_tween_init
- flux_tween_time_left
- flux_update
- quadratic_in
- quadratic_in_out
- quadratic_out
- quartic_in
- quartic_in_out
- quartic_out
- quintic_in
- quintic_in_out
- quintic_out
- sine_in
- sine_in_out
- sine_out
Procedure Groups (0)
This section is empty.
Types
Ease ¶
Ease :: enum int { Linear, Quadratic_In, Quadratic_Out, Quadratic_In_Out, Cubic_In, Cubic_Out, Cubic_In_Out, Quartic_In, Quartic_Out, Quartic_In_Out, Quintic_In, Quintic_Out, Quintic_In_Out, Sine_In, Sine_Out, Sine_In_Out, Circular_In, Circular_Out, Circular_In_Out, Exponential_In, Exponential_Out, Exponential_In_Out, Elastic_In, Elastic_Out, Elastic_In_Out, Back_In, Back_Out, Back_In_Out, Bounce_In, Bounce_Out, Bounce_In_Out, }
Related Procedures With Parameters
Flux_Map ¶
Flux_Map :: struct($Value: typeid) {}
Related Procedures With Parameters
Related Procedures With Returns
Flux_Tween ¶
Flux_Tween :: struct($Value: typeid) {}
Related Procedures With Parameters
Related Procedures With Returns
Constants
This section is empty.
Variables
This section is empty.
Procedures
back_in ¶
back_in :: proc "contextless" (p: $T) -> $T {…}
Modeled after the overshooting cubic y = x^3-xsin(xpi)
back_in_out ¶
back_in_out :: proc "contextless" (p: $T) -> $T {…}
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]
back_out ¶
back_out :: proc "contextless" (p: $T) -> $T {…}
Modeled after overshooting cubic y = 1-((1-x)^3-(1-x)sin((1-x)pi))
bounce_in ¶
bounce_in :: proc "contextless" (p: $T) -> $T {…}
bounce_in_out ¶
bounce_in_out :: proc "contextless" (p: $T) -> $T {…}
bounce_out ¶
bounce_out :: proc "contextless" (p: $T) -> $T {…}
circular_in ¶
circular_in :: proc "contextless" (p: $T) -> $T {…}
Modeled after shifted quadrant IV of unit circle
circular_in_out ¶
circular_in_out :: proc "contextless" (p: $T) -> $T {…}
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]
circular_out ¶
circular_out :: proc "contextless" (p: $T) -> $T {…}
Modeled after shifted quadrant II of unit circle
cubic_in_out ¶
cubic_in_out :: proc "contextless" (p: $T) -> $T {…}
Modeled after the piecewise cubic y = (1/2)((2x)^3) ; [0, 0.5) y = (1/2)((2x-2)^3 + 2) ; [0.5, 1]
cubic_out ¶
cubic_out :: proc "contextless" (p: $T) -> $T {…}
Modeled after the cubic y = (x - 1)^3 + 1
elastic_in ¶
elastic_in :: proc "contextless" (p: $T) -> $T {…}
Modeled after the damped sine wave y = sin(13pi/2x)pow(2, 10 * (x - 1))
elastic_in_out ¶
elastic_in_out :: proc "contextless" (p: $T) -> $T {…}
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]
elastic_out ¶
elastic_out :: proc "contextless" (p: $T) -> $T {…}
Modeled after the damped sine wave y = sin(-13pi/2(x + 1))pow(2, -10x) + 1
exponential_in ¶
exponential_in :: proc "contextless" (p: $T) -> $T {…}
Modeled after the exponential function y = 2^(10(x - 1))
exponential_in_out ¶
exponential_in_out :: proc "contextless" (p: $T) -> $T {…}
Modeled after the piecewise exponential y = (1/2)2^(10(2x - 1)) ; [0,0.5) y = -(1/2)*2^(-10(2x - 1))) + 1 ; [0.5,1]
exponential_out ¶
exponential_out :: proc "contextless" (p: $T) -> $T {…}
Modeled after the exponential function y = -2^(-10x) + 1
flux_init ¶
init flux map to a float type and a wanted cap
flux_stop ¶
stop a specific key inside the map returns true when it successfully removed the key
flux_to ¶
flux_to :: proc( flux: ^Flux_Map($T), value: ^$T, goal: $T, type: Ease = .Quadratic_Out, duration: time.Duration = time.Second, delay: f64 = 0, ) -> (tween: ^Flux_Tween($T)) {…}
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_tween_init ¶
flux_tween_init :: proc(tween: ^Flux_Tween($T), duration: time.Duration) {…}
init internal properties
flux_tween_time_left ¶
returns the amount of time left for the tween animation, if the key exists in the map returns 0 if the tween doesnt exist on the map
flux_update ¶
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 "contextless" (p: $T) -> $T {…}
Modeled after the parabola y = x^2
quadratic_in_out ¶
quadratic_in_out :: proc "contextless" (p: $T) -> $T {…}
Modeled after the piecewise quadratic y = (1/2)((2x)^2) ; [0, 0.5) y = -(1/2)((2x-1)*(2x-3) - 1) ; [0.5, 1]
quadratic_out ¶
quadratic_out :: proc "contextless" (p: $T) -> $T {…}
Modeled after the parabola y = -x^2 + 2x
quartic_in_out ¶
quartic_in_out :: proc "contextless" (p: $T) -> $T {…}
Modeled after the piecewise quartic y = (1/2)((2x)^4) ; [0, 0.5) y = -(1/2)((2x-2)^4 - 2) ; [0.5, 1]
quartic_out ¶
quartic_out :: proc "contextless" (p: $T) -> $T {…}
Modeled after the quartic y = 1 - (x - 1)^4
quintic_in_out ¶
quintic_in_out :: proc "contextless" (p: $T) -> $T {…}
Modeled after the piecewise quintic y = (1/2)((2x)^5) ; [0, 0.5) y = (1/2)((2x-2)^5 + 2) ; [0.5, 1]
quintic_out ¶
quintic_out :: proc "contextless" (p: $T) -> $T {…}
Modeled after the quintic y = (x - 1)^5 + 1
sine_out ¶
sine_out :: proc "contextless" (p: $T) -> $T {…}
Modeled after quarter-cycle of sine wave (different phase)
Procedure Groups
This section is empty.
Source Files
Generation Information
Generated with odin version dev-2024-10 (vendor "odin") Windows_amd64 @ 2024-10-05 21:10:06.174652600 +0000 UTC