feat: new block custom models implementation (WIP)

This commit is contained in:
MihailRis
2024-11-05 19:28:40 +03:00
parent c95c97430a
commit 5e0bcf8ec0
14 changed files with 189 additions and 149 deletions
+7
View File
@@ -1,6 +1,7 @@
#pragma once
#include <cmath>
#include <glm/vec2.hpp>
struct UVRegion {
float u1;
@@ -33,4 +34,10 @@ struct UVRegion {
u2 = u1 + uvw * w;
v2 = v1 + uvh * h;
}
inline glm::vec2 apply(const glm::vec2& uv) {
float w = getWidth();
float h = getHeight();
return glm::vec2(u1 + uv.x / w, v1 + uv.y / h);
}
};