diff options
-rw-r--r-- | .github/workflows/android_builds.yml | 1 | ||||
-rw-r--r-- | .github/workflows/javascript_builds.yml | 1 | ||||
-rw-r--r-- | .github/workflows/linux_builds.yml | 2 | ||||
-rw-r--r-- | .github/workflows/static_checks.yml | 8 | ||||
-rw-r--r-- | scene/2d/cpu_particles_2d.cpp | 6 | ||||
-rw-r--r-- | scene/3d/cpu_particles_3d.cpp | 16 |
6 files changed, 25 insertions, 9 deletions
diff --git a/.github/workflows/android_builds.yml b/.github/workflows/android_builds.yml index c591b4bb39..6b16c10b3e 100644 --- a/.github/workflows/android_builds.yml +++ b/.github/workflows/android_builds.yml @@ -18,6 +18,7 @@ jobs: # Azure repositories are not reliable, we need to prevent azure giving us packages. - name: Make apt sources.list use the default Ubuntu repositories run: | + sudo rm -f /etc/apt/sources.list.d/* sudo cp -f misc/ci/sources.list /etc/apt/sources.list sudo apt-get update diff --git a/.github/workflows/javascript_builds.yml b/.github/workflows/javascript_builds.yml index 421906c77f..09c4c41d53 100644 --- a/.github/workflows/javascript_builds.yml +++ b/.github/workflows/javascript_builds.yml @@ -19,6 +19,7 @@ jobs: # Azure repositories are not reliable, we need to prevent azure giving us packages. - name: Make apt sources.list use the default Ubuntu repositories run: | + sudo rm -f /etc/apt/sources.list.d/* sudo cp -f misc/ci/sources.list /etc/apt/sources.list sudo apt-get update diff --git a/.github/workflows/linux_builds.yml b/.github/workflows/linux_builds.yml index 198727b30e..85ae6a5a8f 100644 --- a/.github/workflows/linux_builds.yml +++ b/.github/workflows/linux_builds.yml @@ -17,6 +17,7 @@ jobs: # Azure repositories are not reliable, we need to prevent azure giving us packages. - name: Make apt sources.list use the default Ubuntu repositories run: | + sudo rm -f /etc/apt/sources.list.d/* sudo cp -f misc/ci/sources.list /etc/apt/sources.list sudo apt-get update @@ -77,6 +78,7 @@ jobs: # Azure repositories are not reliable, we need to prevent azure giving us packages. - name: Make apt sources.list use the default Ubuntu repositories run: | + sudo rm -f /etc/apt/sources.list.d/* sudo cp -f misc/ci/sources.list /etc/apt/sources.list sudo apt-get update diff --git a/.github/workflows/static_checks.yml b/.github/workflows/static_checks.yml index 2a7a4e6625..ee01dba2ba 100644 --- a/.github/workflows/static_checks.yml +++ b/.github/workflows/static_checks.yml @@ -9,9 +9,15 @@ jobs: - name: Checkout uses: actions/checkout@v2 + # Azure repositories are not reliable, we need to prevent azure giving us packages. + - name: Make apt sources.list use the default Ubuntu repositories + run: | + sudo rm -f /etc/apt/sources.list.d/* + sudo cp -f misc/ci/sources.list /etc/apt/sources.list + sudo apt-get update + - name: Install dependencies run: | - sudo apt-get update -qq sudo apt-get install -qq dos2unix recode clang-format sudo pip3 install git+https://github.com/psf/black@master pygments diff --git a/scene/2d/cpu_particles_2d.cpp b/scene/2d/cpu_particles_2d.cpp index 526951976e..e3a632c98a 100644 --- a/scene/2d/cpu_particles_2d.cpp +++ b/scene/2d/cpu_particles_2d.cpp @@ -749,7 +749,11 @@ void CPUParticles2D::_particles_process(float p_delta) { p.transform[2] = emission_points.get(random_idx); if (emission_shape == EMISSION_SHAPE_DIRECTED_POINTS && emission_normals.size() == pc) { - p.velocity = emission_normals.get(random_idx); + Vector2 normal = emission_normals.get(random_idx); + Transform2D m2; + m2.set_axis(0, normal); + m2.set_axis(1, normal.tangent()); + p.velocity = m2.basis_xform(p.velocity); } if (emission_colors.size() == pc) { diff --git a/scene/3d/cpu_particles_3d.cpp b/scene/3d/cpu_particles_3d.cpp index 4244a11592..ad8760251f 100644 --- a/scene/3d/cpu_particles_3d.cpp +++ b/scene/3d/cpu_particles_3d.cpp @@ -726,13 +726,15 @@ void CPUParticles3D::_particles_process(float p_delta) { if (emission_shape == EMISSION_SHAPE_DIRECTED_POINTS && emission_normals.size() == pc) { if (flags[FLAG_DISABLE_Z]) { - /* - mat2 rotm; - "; - rotm[0] = texelFetch(emission_texture_normal, emission_tex_ofs, 0).xy; - rotm[1] = rotm[0].yx * vec2(1.0, -1.0); - VELOCITY.xy = rotm * VELOCITY.xy; - */ + Vector3 normal = emission_normals.get(random_idx); + Vector2 normal_2d(normal.x, normal.y); + Transform2D m2; + m2.set_axis(0, normal_2d); + m2.set_axis(1, normal_2d.tangent()); + Vector2 velocity_2d(p.velocity.x, p.velocity.y); + velocity_2d = m2.basis_xform(velocity_2d); + p.velocity.x = velocity_2d.x; + p.velocity.y = velocity_2d.y; } else { Vector3 normal = emission_normals.get(random_idx); Vector3 v0 = Math::abs(normal.z) < 0.999 ? Vector3(0.0, 0.0, 1.0) : Vector3(0, 1.0, 0.0); |