Most of the transforms kind of work now need to hook in the new timer.

This commit is contained in:
Zed A. Shaw 2026-01-27 23:39:09 -05:00
parent 20d7612f1c
commit 7f14a39edf
6 changed files with 47 additions and 27 deletions

View file

@ -15,7 +15,7 @@ namespace ease2 {
return (std::sin(x) + 1.0) / 2.0;
}
double out_circ(double x) {
double out_circle(double x) {
return std::sqrt(1.0f - ((x - 1.0f) * (x - 1.0f)));
}
@ -46,11 +46,11 @@ namespace ease2 {
: (std::pow(2.0 * x - 2.0, 2.0) * ((c2 + 1.0) * (x * 2.0 - 2.0) + c2) + 2.0) / 2.0;
}
float random(float tick) {
double random(double tick) {
return Random::uniform_real(0.0001f, 1.0f);
}
float normal_dist(float tick) {
double normal_dist(double tick) {
return Random::normal(0.5f, 0.1f);
}
@ -66,7 +66,6 @@ namespace ease2 {
scale_out.x = std::lerp(tr.min_x, tr.max_x, tick);
scale_out.y = std::lerp(tr.min_y, tr.max_y, tick);
pos_out.y = pos_out.y - (pos_out.y * scale_out.y - pos_out.y);
fmt::println("RUSH pos={},{}; scale={},{}; tic={}", pos_out.x, pos_out.y, scale_out.x, scale_out.y, tick);
}
void scale_squeeze(Transform &tr, sf::Vector2f& pos_out, sf::Vector2f& scale_out, float tick) {
@ -77,7 +76,7 @@ namespace ease2 {
scale_out.y *= std::lerp(tr.min_y, tr.max_y, tick);
}
void scale_strech(Transform &tr, sf::Vector2f& pos_out, sf::Vector2f& scale_out, float tick) {
void scale_stretch(Transform &tr, sf::Vector2f& pos_out, sf::Vector2f& scale_out, float tick) {
scale_out.x = std::lerp(tr.min_x, tr.max_x, tick);
}
@ -86,8 +85,8 @@ namespace ease2 {
}
void move_slide(Transform &tr, sf::Vector2f& pos_out, sf::Vector2f& scale_out, float tick) {
pos_out.x = std::lerp(tr.min_x, tr.max_x, tick);
pos_out.y = std::lerp(tr.min_y, tr.max_y, tick);
pos_out.x += std::lerp(tr.min_x, tr.max_x, tick);
pos_out.y += std::lerp(tr.min_y, tr.max_y, tick);
}
void move_none(Transform &tr, sf::Vector2f& pos_out, sf::Vector2f& scale_out, float tick) {