vanilladocs
vanillapunch.com
API / core/tween/easing_function/bounce

core/tween/easing_function/bounce

바닥에 튕긴다.

Bounces on the floor.

예제Example튕기는 자리의 값Values at the bounce points
use vanilla::easing_function::bounce;

assert_eq!(bounce::ease_out(0.0), 0.0);
assert!((bounce::ease_out(0.5) - 0.765625).abs() < 1e-6);
assert!((bounce::ease_out(1.0) - 1.0).abs() < 1e-6);
assert_eq!(bounce::ease_in_out(0.5), 0.5);

함수Functions

함수functionpub fn ease_in(progress: f64) -> f64#0.4.0 부터since 0.4.0소스source

시작에서 튕기다 나아간다.

Bounces at the start, then moves forward.

progressf64
진행률. (0 ~ 1)Progress. (0 ~ 1)

반환Returnsf64 보간 비율. (0 ~ 1, 0 에서 0, 1 에서 1)Interpolation ratio. (0 ~ 1, 0 at 0, 1 at 1)

함수functionpub fn ease_out(progress: f64) -> f64#0.4.0 부터since 0.4.0소스source

끝에 닿아 튕기다 멈춘다.

Hits the end and bounces to a stop.

progressf64
진행률. (0 ~ 1)Progress. (0 ~ 1)

반환Returnsf64 보간 비율. (0 ~ 1, 0 에서 0, 1 에서 1)Interpolation ratio. (0 ~ 1, 0 at 0, 1 at 1)

함수functionpub fn ease_in_out(progress: f64) -> f64#0.4.0 부터since 0.4.0소스source

시작과 끝에서 튕긴다.

Bounces at the start and the end.

progressf64
진행률. (0 ~ 1)Progress. (0 ~ 1)

반환Returnsf64 보간 비율. (0 ~ 1, 0 에서 0, 1 에서 1)Interpolation ratio. (0 ~ 1, 0 at 0, 1 at 1)