add <image ...> atlases support

This commit is contained in:
MihailRis
2024-06-30 22:05:12 +03:00
parent c0dca31e98
commit 2dffdf757c
7 changed files with 56 additions and 17 deletions
+10
View File
@@ -1,6 +1,8 @@
#ifndef MATHS_UVREGION_HPP_
#define MATHS_UVREGION_HPP_
#include <cmath>
struct UVRegion {
float u1;
float v1;
@@ -11,6 +13,14 @@ struct UVRegion {
: u1(u1), v1(v1), u2(u2), v2(v2){}
UVRegion() : u1(0.0f), v1(0.0f), u2(1.0f), v2(1.0f){}
inline float getWidth() const {
return fabs(u2-u1);
}
inline float getHeight() const {
return fabs(v2-v1);
}
};
#endif // MATHS_UVREGION_HPP_