|
@@ -56084,6 +56084,7 @@ var BABYLON;
|
|
|
directionScale_1 *= BABYLON.Scalar.Lerp(particle._currentVelocity1, particle._currentVelocity2, scale);
|
|
|
});
|
|
|
}
|
|
|
+ particle.direction.scaleToRef(directionScale_1, _this._scaledDirection);
|
|
|
/// Limit velocity
|
|
|
if (_this._limitVelocityGradients && _this._limitVelocityGradients.length > 0) {
|
|
|
BABYLON.Tools.GetCurrentGradient(ratio, _this._limitVelocityGradients, function (currentGradient, nextGradient, scale) {
|
|
@@ -56093,12 +56094,12 @@ var BABYLON;
|
|
|
particle._currentLimitVelocityGradient = currentGradient;
|
|
|
}
|
|
|
var limitVelocity = BABYLON.Scalar.Lerp(particle._currentLimitVelocity1, particle._currentLimitVelocity2, scale);
|
|
|
- if (directionScale_1 / _this._scaledUpdateSpeed > limitVelocity) {
|
|
|
- directionScale_1 *= _this.limitVelocityDamping;
|
|
|
+ var currentVelocity = particle.direction.length();
|
|
|
+ if (currentVelocity > limitVelocity) {
|
|
|
+ particle.direction.scaleInPlace(_this.limitVelocityDamping);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
- particle.direction.scaleToRef(directionScale_1, _this._scaledDirection);
|
|
|
particle.position.addInPlace(_this._scaledDirection);
|
|
|
// Noise
|
|
|
if (noiseTextureData && noiseTextureSize) {
|