feat: new block custom models implementation (WIP)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user