Created
July 12, 2023 16:48
-
-
Save Andrey2470T/5a2b4af215f65306dfbaeae1a47e132e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Unfinished code of the future animation support for this type | |
v2f ll_corner_coords(0.0f, 0.0f); | |
v2f ur_corner_coords(1.0f, 1.0f); | |
if (params.animation.type != TAT_NONE) | |
{ | |
core::dimension2du tex_size = mat.getTexture(0)->getSize(); | |
v2u32 frame_size; | |
params.animation.determineParams(tex_size, nullptr, nullptr, &frame_size); | |
ll_corner_coords = params.animation.getTextureCoords(tex_size, current_animation_frame); | |
ur_corner_coords = v2f( | |
ll_corner_coords.X + (f32)frame_size.X / tex_size.Width, | |
ll_corner_coords.Y + (f32)frame_size.Y / tex_size.Height | |
); | |
} | |
v2f center_tcoords = (ll_corner_coords + ur_corner_coords) / 2.0f; | |
v2f shift(ll_corner_coords.X - center_tcoords.X, 0.0f); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment