summaryrefslogtreecommitdiffhomepage
path: root/src/anim-atlas.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-11-08 02:55:34 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-11-08 02:55:34 +0100
commit2e753568b4024e6c84b9c49db6cfdcae20277b28 (patch)
tree695a3fb6baf2258b8bcc58d28e887eb6f4c7dcc5 /src/anim-atlas.cpp
parent69324ea83c8c4e73e5e201e0ca53114484a49791 (diff)
fix anim offsets
Diffstat (limited to 'src/anim-atlas.cpp')
-rw-r--r--src/anim-atlas.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/anim-atlas.cpp b/src/anim-atlas.cpp
index 4b502208..8326ac5e 100644
--- a/src/anim-atlas.cpp
+++ b/src/anim-atlas.cpp
@@ -86,12 +86,11 @@ auto anim_atlas::frame_quad(const Vector3& center, rotation r, std::size_t i) co
const auto f = frame(r, i);
const auto size = Vector2d(f.size);
const double gx = f.ground[0]*.5, gy = f.ground[1]*.5;
- //auto gx = 0, gy = 0;
const double sx = size[0]*.5, sy = size[1]*.5;
const auto bottom_right = Vector2(tile_shader::unproject({ sx - gx, sy - gy })),
- top_right = Vector2(tile_shader::unproject({ sx - gx, -sy - gy })),
- bottom_left = Vector2(tile_shader::unproject({ -sx - gx, sy - gy })),
- top_left = Vector2(tile_shader::unproject({ -sx - gx, -sy - gy }));
+ top_right = Vector2(tile_shader::unproject({ sx - gx, - gy })),
+ bottom_left = Vector2(tile_shader::unproject({ - gx, sy - gy })),
+ top_left = Vector2(tile_shader::unproject({ - gx, - gy }));
const auto cx = center[0], cy = center[1], cz = center[2];
return {{
{ cx + bottom_right[0], cy + bottom_right[1], cz },