fix: 'box' primitive uv & update stairs model
This commit is contained in:
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user