Merge pull request #51690 from QbieShay/rotate-y-fix

fixed rotate y flag causing the position to reset
This commit is contained in:
Rémi Verschelde 2021-08-15 12:18:54 +02:00 committed by GitHub
commit 450f7fdc39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -634,7 +634,7 @@ void ParticlesMaterial::_update_shader() {
}
// turn particle by rotation in Y
if (flags[FLAG_ROTATE_Y]) {
code += " TRANSFORM = mat4(vec4(cos(CUSTOM.x), 0.0, -sin(CUSTOM.x), 0.0), vec4(0.0, 1.0, 0.0, 0.0), vec4(sin(CUSTOM.x), 0.0, cos(CUSTOM.x), 0.0), vec4(0.0, 0.0, 0.0, 1.0));\n";
code += " TRANSFORM = mat4(vec4(cos(CUSTOM.x), 0.0, -sin(CUSTOM.x), 0.0), vec4(0.0, 1.0, 0.0, 0.0), vec4(sin(CUSTOM.x), 0.0, cos(CUSTOM.x), 0.0), TRANSFORM[3]);\n";
}
}
//scale by scale