sebastien 6 лет назад
Родитель
Сommit
1d554bd107
3 измененных файлов с 19 добавлено и 6 удалено
  1. 13 0
      src/Engine/constants.ts
  2. 3 3
      src/Particles/baseParticleSystem.ts
  3. 3 3
      src/Particles/particleSystem.ts

+ 13 - 0
src/Engine/constants.ts

@@ -331,4 +331,17 @@ export class Constants {
      * @see http://doc.babylonjs.com/how_to/how_to_use_actions#triggers
      */
     public static readonly ACTION_OnKeyUpTrigger = 15;
+
+    /**
+     * Billboard mode will only apply to Y axis
+     */
+    public static readonly PARTICLES_BILLBOARDMODE_Y = 2;
+    /**
+     * Billboard mode will apply to all axes
+     */
+    public static readonly PARTICLES_BILLBOARDMODE_ALL = 7;
+    /**
+     * Special billboard mode where the particle will be biilboard to the camera but rotated to align with direction
+     */
+    public static readonly PARTICLES_BILLBOARDMODE_STRETCHED = 8;
 }

+ 3 - 3
src/Particles/baseParticleSystem.ts

@@ -9,7 +9,7 @@ import { Scene } from "scene";
 import { ColorGradient, FactorGradient, Color3Gradient, IValueGradient } from "Tools/tools";
 import { Animation } from "Animations/animation";
 import { BoxParticleEmitter, IParticleEmitterType, PointParticleEmitter, HemisphericParticleEmitter, SphereParticleEmitter, SphereDirectedParticleEmitter, CylinderParticleEmitter, CylinderDirectedParticleEmitter, ConeParticleEmitter } from "Particles/EmitterTypes";
-import { ParticleSystem } from "./particleSystem";
+import { Constants } from "Engine/constants";
 
     /**
      * This represents the base class for particle system in Babylon.
@@ -191,7 +191,7 @@ import { ParticleSystem } from "./particleSystem";
         /**
          * Blend mode use to render the particle, it can be either ParticleSystem.BLENDMODE_ONEONE or ParticleSystem.BLENDMODE_STANDARD.
          */
-        public blendMode = ParticleSystem.BLENDMODE_ONEONE;
+        public blendMode = BaseParticleSystem.BLENDMODE_ONEONE;
 
         /**
          * Forces the particle to write their depth information to the depth buffer. This can help preventing other draw calls
@@ -515,7 +515,7 @@ import { ParticleSystem } from "./particleSystem";
          * Gets or sets the billboard mode to use when isBillboardBased = true.
          * Value can be: ParticleSystem.BILLBOARDMODE_ALL, ParticleSystem.BILLBOARDMODE_Y, ParticleSystem.BILLBOARDMODE_STRETCHED
          */
-        public billboardMode = ParticleSystem.BILLBOARDMODE_ALL;
+        public billboardMode = Constants.PARTICLES_BILLBOARDMODE_ALL;
 
         protected _isBillboardBased = true;
         /**

+ 3 - 3
src/Particles/particleSystem.ts

@@ -35,15 +35,15 @@ import { SerializationHelper } from "Tools/decorators";
         /**
          * Billboard mode will only apply to Y axis
          */
-        public static readonly BILLBOARDMODE_Y = 2;
+        public static readonly BILLBOARDMODE_Y = Constants.PARTICLES_BILLBOARDMODE_Y;
         /**
          * Billboard mode will apply to all axes
          */
-        public static readonly BILLBOARDMODE_ALL = 7;
+        public static readonly BILLBOARDMODE_ALL = Constants.PARTICLES_BILLBOARDMODE_ALL;
         /**
          * Special billboard mode where the particle will be biilboard to the camera but rotated to align with direction
          */
-        public static readonly BILLBOARDMODE_STRETCHED = 8;
+        public static readonly BILLBOARDMODE_STRETCHED = Constants.PARTICLES_BILLBOARDMODE_STRETCHED;
 
         /**
          * This function can be defined to provide custom update for active particles.