diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-07 16:31:31 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-07 16:31:31 +0100 |
commit | 8df4de4557ea49ff39462505a0662aacca447bf3 (patch) | |
tree | f2620bc4d9337f32bbc009c0bc77b40ee9370f76 /src/anim-atlas.cpp | |
parent | 151e1f9a56bce31c2703610980c00fc8f527aa6a (diff) |
animations kinda work
Diffstat (limited to 'src/anim-atlas.cpp')
-rw-r--r-- | src/anim-atlas.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/anim-atlas.cpp b/src/anim-atlas.cpp index 093ece73..0bd886bc 100644 --- a/src/anim-atlas.cpp +++ b/src/anim-atlas.cpp @@ -92,12 +92,12 @@ auto anim_atlas::frame_quad(const Vector3& center, rotation r, std::size_t i) co auto anim_atlas::frame_quad(const Vector3& center, const anim_frame& frame) noexcept -> quad { const auto size = Vector2d(frame.size); - const double gx = frame.ground[0], gy = frame.ground[1]; + const double gx = frame.ground[0]*.25, gy = frame.ground[1]*.25; const double sx = size[0]*.25, sy = size[1]*.25; - 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 })); + 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 })); const auto cx = center[0], cy = center[1], cz = center[2]; return {{ { cx + bottom_right[0], cy + bottom_right[1], cz }, |