mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
add <image ...> atlases support
This commit is contained in:
parent
c0dca31e98
commit
2dffdf757c
7 changed files with 56 additions and 17 deletions
|
|
@ -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_
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue