Explorar o código

Merge pull request #8238 from sebavan/master

Animate Particles when frozen
David Catuhe %!s(int64=5) %!d(string=hai) anos
pai
achega
5a914145aa
Modificáronse 3 ficheiros con 9 adicións e 2 borrados
  1. 1 1
      src/Particles/gpuParticleSystem.ts
  2. 1 1
      src/Particles/particleSystem.ts
  3. 7 0
      src/scene.ts

+ 1 - 1
src/Particles/gpuParticleSystem.ts

@@ -1682,7 +1682,7 @@ export class GPUParticleSystem extends BaseParticleSystem implements IDisposable
         var result = new GPUParticleSystem(name, { capacity: this._capacity, randomTextureSize: this._randomTextureSize }, this._scene);
         result._customEffect = custom;
 
-        DeepCopier.DeepCopy(this, result, ["particles", "customShader", "noiseTexture", "particleTexture", "onDisposeObservable"]);
+        DeepCopier.DeepCopy(this, result, ["particles", "customShader", "noiseTexture", "particleTexture", "onDisposeObservable", "vertexShaderName"]);
 
         if (newEmitter === undefined) {
             newEmitter = this.emitter;

+ 1 - 1
src/Particles/particleSystem.ts

@@ -2065,7 +2065,7 @@ export class ParticleSystem extends BaseParticleSystem implements IDisposable, I
         result.customShader = program;
         result._customEffect = custom;
 
-        DeepCopier.DeepCopy(this, result, ["particles", "customShader", "noiseTexture", "particleTexture", "onDisposeObservable"]);
+        DeepCopier.DeepCopy(this, result, ["particles", "customShader", "noiseTexture", "particleTexture", "onDisposeObservable", "vertexShaderName"]);
 
         if (newEmitter === undefined) {
             newEmitter = this.emitter;

+ 7 - 0
src/scene.ts

@@ -3478,6 +3478,13 @@ export class Scene extends AbstractScene implements IAnimatable {
                 }
             }
 
+            if (this._activeParticleSystems) {
+                const psLength = this._activeParticleSystems.length;
+                for (let i = 0; i < psLength; i++) {
+                    this._activeParticleSystems.data[i].animate();
+                }
+            }
+
             return;
         }