16 lines
342 B
JavaScript
16 lines
342 B
JavaScript
export function easeOutCubic(progress) {
|
|
return 1 - (1 - progress) ** 3;
|
|
}
|
|
|
|
export function easeInOutCubic(progress) {
|
|
if (progress < 0.5) {
|
|
return 4 * progress ** 3;
|
|
}
|
|
|
|
return 1 - ((-2 * progress + 2) ** 3) / 2;
|
|
}
|
|
|
|
export function arcadePhysicsTimeScale(sceneTimeScale) {
|
|
return 1 / Math.max(sceneTimeScale, Number.EPSILON);
|
|
}
|