mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 20:41:49 +00:00
feat: new block custom models implementation (WIP)
This commit is contained in:
parent
c95c97430a
commit
5e0bcf8ec0
14 changed files with 189 additions and 149 deletions
|
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue