add 'random_sub_uv' particle setting

This commit is contained in:
MihailRis
2024-11-03 16:49:31 +03:00
parent c8187c5f25
commit 86b83a5377
5 changed files with 31 additions and 2 deletions
+11
View File
@@ -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;
}
};