fix: 'box' primitive uv & update stairs model

This commit is contained in:
MihailRis
2025-05-29 20:53:39 +03:00
parent 407184250c
commit 45f845eb10
6 changed files with 21 additions and 11 deletions
+8 -2
View File
@@ -43,8 +43,8 @@ struct UVRegion {
}
void scale(float x, float y) {
float w = getWidth();
float h = getHeight();
float w = u2 - u1;
float h = v2 - v1;
float cx = (u1 + u2) * 0.5f;
float cy = (v1 + v2) * 0.5f;
u1 = cx - w * 0.5f * x;
@@ -63,4 +63,10 @@ struct UVRegion {
u2 = vec.z;
v2 = vec.w;
}
UVRegion operator*(const glm::vec2& scale) const {
auto copy = UVRegion(*this);
copy.scale(scale);
return copy;
}
};