mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 03:21:49 +00:00
fix: 'box' primitive uv & update stairs model
This commit is contained in:
parent
407184250c
commit
45f845eb10
6 changed files with 21 additions and 11 deletions
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue