|
@@ -50541,22 +50541,6 @@ var BABYLON;
|
|
|
*/
|
|
|
this.gravity = BABYLON.Vector3.Zero();
|
|
|
/**
|
|
|
- * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.
|
|
|
- */
|
|
|
- this.direction1 = new BABYLON.Vector3(0, 1.0, 0);
|
|
|
- /**
|
|
|
- * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.
|
|
|
- */
|
|
|
- this.direction2 = new BABYLON.Vector3(0, 1.0, 0);
|
|
|
- /**
|
|
|
- * Minimum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.
|
|
|
- */
|
|
|
- this.minEmitBox = new BABYLON.Vector3(-0.5, -0.5, -0.5);
|
|
|
- /**
|
|
|
- * Maximum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.
|
|
|
- */
|
|
|
- this.maxEmitBox = new BABYLON.Vector3(0.5, 0.5, 0.5);
|
|
|
- /**
|
|
|
* Random color of each particle after it has been emitted, between color1 and color2 vectors.
|
|
|
*/
|
|
|
this.color1 = new BABYLON.Color4(1.0, 1.0, 1.0, 1.0);
|
|
@@ -50639,8 +50623,8 @@ var BABYLON;
|
|
|
this._vertexBuffers[BABYLON.VertexBuffer.PositionKind] = positions;
|
|
|
this._vertexBuffers[BABYLON.VertexBuffer.ColorKind] = colors;
|
|
|
this._vertexBuffers["options"] = options;
|
|
|
- // Default behaviors
|
|
|
- this.particleEmitterType = new BABYLON.BoxParticleEmitter(this);
|
|
|
+ // Default emitter type
|
|
|
+ this.particleEmitterType = new BABYLON.BoxParticleEmitter();
|
|
|
this.updateFunction = function (particles) {
|
|
|
for (var index = 0; index < particles.length; index++) {
|
|
|
var particle = particles[index];
|
|
@@ -50667,6 +50651,82 @@ var BABYLON;
|
|
|
}
|
|
|
};
|
|
|
}
|
|
|
+ Object.defineProperty(ParticleSystem.prototype, "direction1", {
|
|
|
+ /**
|
|
|
+ * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.
|
|
|
+ * This only works when particleEmitterTyps is a BoxParticleEmitter
|
|
|
+ */
|
|
|
+ get: function () {
|
|
|
+ if (this.particleEmitterType.direction1) {
|
|
|
+ return this.particleEmitterType.direction1;
|
|
|
+ }
|
|
|
+ return BABYLON.Vector3.Zero();
|
|
|
+ },
|
|
|
+ set: function (value) {
|
|
|
+ if (this.particleEmitterType.direction1) {
|
|
|
+ this.particleEmitterType.direction1 = value;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ enumerable: true,
|
|
|
+ configurable: true
|
|
|
+ });
|
|
|
+ Object.defineProperty(ParticleSystem.prototype, "direction2", {
|
|
|
+ /**
|
|
|
+ * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.
|
|
|
+ * This only works when particleEmitterTyps is a BoxParticleEmitter
|
|
|
+ */
|
|
|
+ get: function () {
|
|
|
+ if (this.particleEmitterType.direction2) {
|
|
|
+ return this.particleEmitterType.direction2;
|
|
|
+ }
|
|
|
+ return BABYLON.Vector3.Zero();
|
|
|
+ },
|
|
|
+ set: function (value) {
|
|
|
+ if (this.particleEmitterType.direction2) {
|
|
|
+ this.particleEmitterType.direction2 = value;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ enumerable: true,
|
|
|
+ configurable: true
|
|
|
+ });
|
|
|
+ Object.defineProperty(ParticleSystem.prototype, "minEmitBox", {
|
|
|
+ /**
|
|
|
+ * Minimum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.
|
|
|
+ * This only works when particleEmitterTyps is a BoxParticleEmitter
|
|
|
+ */
|
|
|
+ get: function () {
|
|
|
+ if (this.particleEmitterType.minEmitBox) {
|
|
|
+ return this.particleEmitterType.minEmitBox;
|
|
|
+ }
|
|
|
+ return BABYLON.Vector3.Zero();
|
|
|
+ },
|
|
|
+ set: function (value) {
|
|
|
+ if (this.particleEmitterType.minEmitBox) {
|
|
|
+ this.particleEmitterType.minEmitBox = value;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ enumerable: true,
|
|
|
+ configurable: true
|
|
|
+ });
|
|
|
+ Object.defineProperty(ParticleSystem.prototype, "maxEmitBox", {
|
|
|
+ /**
|
|
|
+ * Maximum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.
|
|
|
+ * This only works when particleEmitterTyps is a BoxParticleEmitter
|
|
|
+ */
|
|
|
+ get: function () {
|
|
|
+ if (this.particleEmitterType.maxEmitBox) {
|
|
|
+ return this.particleEmitterType.maxEmitBox;
|
|
|
+ }
|
|
|
+ return BABYLON.Vector3.Zero();
|
|
|
+ },
|
|
|
+ set: function (value) {
|
|
|
+ if (this.particleEmitterType.maxEmitBox) {
|
|
|
+ this.particleEmitterType.maxEmitBox = value;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ enumerable: true,
|
|
|
+ configurable: true
|
|
|
+ });
|
|
|
Object.defineProperty(ParticleSystem.prototype, "onDispose", {
|
|
|
/**
|
|
|
* Sets a callback that will be triggered when the system is disposed.
|
|
@@ -50974,13 +51034,14 @@ var BABYLON;
|
|
|
};
|
|
|
/**
|
|
|
* Renders the particle system in its current state.
|
|
|
- * @returns the current number of particles.
|
|
|
+ * @returns the current number of particles
|
|
|
*/
|
|
|
ParticleSystem.prototype.render = function () {
|
|
|
var effect = this._getEffect();
|
|
|
// Check
|
|
|
- if (!this.emitter || !effect.isReady() || !this.particleTexture || !this.particleTexture.isReady() || !this._particles.length)
|
|
|
+ if (!this.emitter || !effect.isReady() || !this.particleTexture || !this.particleTexture.isReady() || !this._particles.length) {
|
|
|
return 0;
|
|
|
+ }
|
|
|
var engine = this._scene.getEngine();
|
|
|
// Render
|
|
|
engine.enableEffect(effect);
|
|
@@ -51091,7 +51152,7 @@ var BABYLON;
|
|
|
* @returns the emitter
|
|
|
*/
|
|
|
ParticleSystem.prototype.createBoxEmitter = function (direction1, direction2, minEmitBox, maxEmitBox) {
|
|
|
- var particleEmitter = new BABYLON.BoxParticleEmitter(this);
|
|
|
+ var particleEmitter = new BABYLON.BoxParticleEmitter();
|
|
|
this.direction1 = direction1;
|
|
|
this.direction2 = direction2;
|
|
|
this.minEmitBox = minEmitBox;
|
|
@@ -51290,75 +51351,25 @@ var BABYLON;
|
|
|
// all property should be come public variables and passed through constructor.
|
|
|
/**
|
|
|
* Creates a new instance of @see BoxParticleEmitter
|
|
|
- * @param _particleSystem the particle system associated with the emitter
|
|
|
*/
|
|
|
- function BoxParticleEmitter(_particleSystem) {
|
|
|
- this._particleSystem = _particleSystem;
|
|
|
- }
|
|
|
- Object.defineProperty(BoxParticleEmitter.prototype, "direction1", {
|
|
|
- /**
|
|
|
- * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.
|
|
|
- */
|
|
|
- get: function () {
|
|
|
- return this._particleSystem.direction1;
|
|
|
- },
|
|
|
+ function BoxParticleEmitter() {
|
|
|
/**
|
|
|
* Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.
|
|
|
*/
|
|
|
- set: function (value) {
|
|
|
- this._particleSystem.direction1 = value;
|
|
|
- },
|
|
|
- enumerable: true,
|
|
|
- configurable: true
|
|
|
- });
|
|
|
- Object.defineProperty(BoxParticleEmitter.prototype, "direction2", {
|
|
|
- /**
|
|
|
- * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.
|
|
|
- */
|
|
|
- get: function () {
|
|
|
- return this._particleSystem.direction2;
|
|
|
- },
|
|
|
+ this.direction1 = new BABYLON.Vector3(0, 1.0, 0);
|
|
|
/**
|
|
|
* Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.
|
|
|
*/
|
|
|
- set: function (value) {
|
|
|
- this._particleSystem.direction2 = value;
|
|
|
- },
|
|
|
- enumerable: true,
|
|
|
- configurable: true
|
|
|
- });
|
|
|
- Object.defineProperty(BoxParticleEmitter.prototype, "minEmitBox", {
|
|
|
- /**
|
|
|
- * Minimum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.
|
|
|
- */
|
|
|
- get: function () {
|
|
|
- return this._particleSystem.minEmitBox;
|
|
|
- },
|
|
|
+ this.direction2 = new BABYLON.Vector3(0, 1.0, 0);
|
|
|
/**
|
|
|
* Minimum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.
|
|
|
*/
|
|
|
- set: function (value) {
|
|
|
- this._particleSystem.minEmitBox = value;
|
|
|
- },
|
|
|
- enumerable: true,
|
|
|
- configurable: true
|
|
|
- });
|
|
|
- Object.defineProperty(BoxParticleEmitter.prototype, "maxEmitBox", {
|
|
|
- /**
|
|
|
- * Maximum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.
|
|
|
- */
|
|
|
- get: function () {
|
|
|
- return this._particleSystem.maxEmitBox;
|
|
|
- },
|
|
|
+ this.minEmitBox = new BABYLON.Vector3(-0.5, -0.5, -0.5);
|
|
|
/**
|
|
|
* Maximum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.
|
|
|
*/
|
|
|
- set: function (value) {
|
|
|
- this._particleSystem.maxEmitBox = value;
|
|
|
- },
|
|
|
- enumerable: true,
|
|
|
- configurable: true
|
|
|
- });
|
|
|
+ this.maxEmitBox = new BABYLON.Vector3(0.5, 0.5, 0.5);
|
|
|
+ }
|
|
|
/**
|
|
|
* Called by the particle System when the direction is computed for the created particle.
|
|
|
* @param emitPower is the power of the particle (speed)
|
|
@@ -51389,10 +51400,16 @@ var BABYLON;
|
|
|
* @returns the new emitter
|
|
|
*/
|
|
|
BoxParticleEmitter.prototype.clone = function () {
|
|
|
- var newOne = new BoxParticleEmitter(this._particleSystem);
|
|
|
+ var newOne = new BoxParticleEmitter();
|
|
|
BABYLON.Tools.DeepCopy(this, newOne);
|
|
|
return newOne;
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Called by the {BABYLON.GPUParticleSystem} to setup the update shader
|
|
|
+ * @param effect defines the update shader
|
|
|
+ */
|
|
|
+ BoxParticleEmitter.prototype.applyToShader = function (effect) {
|
|
|
+ };
|
|
|
return BoxParticleEmitter;
|
|
|
}());
|
|
|
BABYLON.BoxParticleEmitter = BoxParticleEmitter;
|
|
@@ -51501,6 +51518,12 @@ var BABYLON;
|
|
|
BABYLON.Tools.DeepCopy(this, newOne);
|
|
|
return newOne;
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Called by the {BABYLON.GPUParticleSystem} to setup the update shader
|
|
|
+ * @param effect defines the update shader
|
|
|
+ */
|
|
|
+ ConeParticleEmitter.prototype.applyToShader = function (effect) {
|
|
|
+ };
|
|
|
return ConeParticleEmitter;
|
|
|
}());
|
|
|
BABYLON.ConeParticleEmitter = ConeParticleEmitter;
|
|
@@ -51575,6 +51598,12 @@ var BABYLON;
|
|
|
BABYLON.Tools.DeepCopy(this, newOne);
|
|
|
return newOne;
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Called by the {BABYLON.GPUParticleSystem} to setup the update shader
|
|
|
+ * @param effect defines the update shader
|
|
|
+ */
|
|
|
+ SphereParticleEmitter.prototype.applyToShader = function (effect) {
|
|
|
+ };
|
|
|
return SphereParticleEmitter;
|
|
|
}());
|
|
|
BABYLON.SphereParticleEmitter = SphereParticleEmitter;
|
|
@@ -51626,6 +51655,12 @@ var BABYLON;
|
|
|
BABYLON.Tools.DeepCopy(this, newOne);
|
|
|
return newOne;
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Called by the {BABYLON.GPUParticleSystem} to setup the update shader
|
|
|
+ * @param effect defines the update shader
|
|
|
+ */
|
|
|
+ SphereDirectedParticleEmitter.prototype.applyToShader = function (effect) {
|
|
|
+ };
|
|
|
return SphereDirectedParticleEmitter;
|
|
|
}(SphereParticleEmitter));
|
|
|
BABYLON.SphereDirectedParticleEmitter = SphereDirectedParticleEmitter;
|
|
@@ -51635,7 +51670,7 @@ var BABYLON;
|
|
|
|
|
|
|
|
|
|
|
|
-//# sourceMappingURL=babylon.iParticleEmitterType.js.map
|
|
|
+//# sourceMappingURL=babylon.IParticleEmitterType.js.map
|
|
|
|
|
|
var BABYLON;
|
|
|
(function (BABYLON) {
|