mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +00:00
add 'random_sub_uv' particle setting
This commit is contained in:
parent
c8187c5f25
commit
86b83a5377
5 changed files with 31 additions and 2 deletions
|
|
@ -22,4 +22,15 @@ struct UVRegion {
|
|||
inline float getHeight() const {
|
||||
return fabs(v2 - v1);
|
||||
}
|
||||
|
||||
void autoSub(float w, float h, float x, float y) {
|
||||
x *= 1.0f - w;
|
||||
y *= 1.0f - h;
|
||||
float uvw = getWidth();
|
||||
float uvh = getHeight();
|
||||
u1 = u1 + uvw * x;
|
||||
v1 = v1 + uvh * y;
|
||||
u2 = u1 + uvw * w;
|
||||
v2 = v1 + uvh * h;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue