|
@@ -59551,11 +59551,26 @@ var BABYLON;
|
|
|
serializationObject.startSizeGradients.push(serializedGradient);
|
|
|
}
|
|
|
}
|
|
|
+ var lifeTimeGradients = particleSystem.getLifeTimeGradients();
|
|
|
+ if (lifeTimeGradients) {
|
|
|
+ serializationObject.lifeTimeGradients = [];
|
|
|
+ for (var _k = 0, lifeTimeGradients_1 = lifeTimeGradients; _k < lifeTimeGradients_1.length; _k++) {
|
|
|
+ var lifeTimeGradient = lifeTimeGradients_1[_k];
|
|
|
+ var serializedGradient = {
|
|
|
+ gradient: lifeTimeGradient.gradient,
|
|
|
+ factor1: lifeTimeGradient.factor1
|
|
|
+ };
|
|
|
+ if (lifeTimeGradient.factor2 !== undefined) {
|
|
|
+ serializedGradient.factor2 = lifeTimeGradient.factor2;
|
|
|
+ }
|
|
|
+ serializationObject.lifeTimeGradients.push(serializedGradient);
|
|
|
+ }
|
|
|
+ }
|
|
|
var limitVelocityGradients = particleSystem.getLimitVelocityGradients();
|
|
|
if (limitVelocityGradients) {
|
|
|
serializationObject.limitVelocityGradients = [];
|
|
|
- for (var _k = 0, limitVelocityGradients_1 = limitVelocityGradients; _k < limitVelocityGradients_1.length; _k++) {
|
|
|
- var limitVelocityGradient = limitVelocityGradients_1[_k];
|
|
|
+ for (var _l = 0, limitVelocityGradients_1 = limitVelocityGradients; _l < limitVelocityGradients_1.length; _l++) {
|
|
|
+ var limitVelocityGradient = limitVelocityGradients_1[_l];
|
|
|
var serializedGradient = {
|
|
|
gradient: limitVelocityGradient.gradient,
|
|
|
factor1: limitVelocityGradient.factor1
|
|
@@ -59714,9 +59729,15 @@ var BABYLON;
|
|
|
particleSystem.addStartSizeGradient(startSizeGradient.gradient, startSizeGradient.factor1 !== undefined ? startSizeGradient.factor1 : startSizeGradient.factor, startSizeGradient.factor2);
|
|
|
}
|
|
|
}
|
|
|
+ if (parsedParticleSystem.lifeTimeGradients) {
|
|
|
+ for (var _x = 0, _y = parsedParticleSystem.lifeTimeGradients; _x < _y.length; _x++) {
|
|
|
+ var lifeTimeGradient = _y[_x];
|
|
|
+ particleSystem.addLifeTimeGradient(lifeTimeGradient.gradient, lifeTimeGradient.factor1 !== undefined ? lifeTimeGradient.factor1 : lifeTimeGradient.factor, lifeTimeGradient.factor2);
|
|
|
+ }
|
|
|
+ }
|
|
|
if (parsedParticleSystem.limitVelocityGradients) {
|
|
|
- for (var _x = 0, _y = parsedParticleSystem.limitVelocityGradients; _x < _y.length; _x++) {
|
|
|
- var limitVelocityGradient = _y[_x];
|
|
|
+ for (var _z = 0, _0 = parsedParticleSystem.limitVelocityGradients; _z < _0.length; _z++) {
|
|
|
+ var limitVelocityGradient = _0[_z];
|
|
|
particleSystem.addLimitVelocityGradient(limitVelocityGradient.gradient, limitVelocityGradient.factor1 !== undefined ? limitVelocityGradient.factor1 : limitVelocityGradient.factor, limitVelocityGradient.factor2);
|
|
|
}
|
|
|
particleSystem.limitVelocityDamping = parsedParticleSystem.limitVelocityDamping;
|
|
@@ -63971,6 +63992,26 @@ var BABYLON;
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
|
});
|
|
|
+ /**
|
|
|
+ * Not supported by GPUParticleSystem
|
|
|
+ * @param gradient defines the gradient to use (between 0 and 1)
|
|
|
+ * @param factor defines the life time factor to affect to the specified gradient
|
|
|
+ * @param factor2 defines an additional factor used to define a range ([factor, factor2]) with main value to pick the final value from
|
|
|
+ * @returns the current particle system
|
|
|
+ */
|
|
|
+ GPUParticleSystem.prototype.addLifeTimeGradient = function (gradient, factor, factor2) {
|
|
|
+ //Not supported by GPUParticleSystem
|
|
|
+ return this;
|
|
|
+ };
|
|
|
+ /**
|
|
|
+ * Not supported by GPUParticleSystem
|
|
|
+ * @param gradient defines the gradient to remove
|
|
|
+ * @returns the current particle system
|
|
|
+ */
|
|
|
+ GPUParticleSystem.prototype.removeLifeTimeGradient = function (gradient) {
|
|
|
+ //Not supported by GPUParticleSystem
|
|
|
+ return this;
|
|
|
+ };
|
|
|
GPUParticleSystem.prototype._reset = function () {
|
|
|
this._releaseBuffers();
|
|
|
};
|
|
@@ -77705,7 +77746,14 @@ var BABYLON;
|
|
|
|
|
|
var BABYLON;
|
|
|
(function (BABYLON) {
|
|
|
+ /**
|
|
|
+ * Manager for handling gamepads
|
|
|
+ */
|
|
|
var GamepadManager = /** @class */ (function () {
|
|
|
+ /**
|
|
|
+ * Initializes the gamepad manager
|
|
|
+ * @param _scene BabylonJS scene
|
|
|
+ */
|
|
|
function GamepadManager(_scene) {
|
|
|
var _this = this;
|
|
|
this._scene = _scene;
|
|
@@ -77713,6 +77761,9 @@ var BABYLON;
|
|
|
this._oneGamepadConnected = false;
|
|
|
/** @hidden */
|
|
|
this._isMonitoring = false;
|
|
|
+ /**
|
|
|
+ * observable to be triggered when the gamepad controller has been disconnected
|
|
|
+ */
|
|
|
this.onGamepadDisconnectedObservable = new BABYLON.Observable();
|
|
|
if (!BABYLON.Tools.IsWindowObjectExist()) {
|
|
|
this._gamepadEventSupported = false;
|
|
@@ -77779,12 +77830,20 @@ var BABYLON;
|
|
|
}
|
|
|
}
|
|
|
Object.defineProperty(GamepadManager.prototype, "gamepads", {
|
|
|
+ /**
|
|
|
+ * The gamepads in the game pad manager
|
|
|
+ */
|
|
|
get: function () {
|
|
|
return this._babylonGamepads;
|
|
|
},
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
|
});
|
|
|
+ /**
|
|
|
+ * Get the gamepad controllers based on type
|
|
|
+ * @param type The type of gamepad controller
|
|
|
+ * @returns Nullable gamepad
|
|
|
+ */
|
|
|
GamepadManager.prototype.getGamepadByType = function (type) {
|
|
|
if (type === void 0) { type = BABYLON.Gamepad.XBOX; }
|
|
|
for (var _i = 0, _a = this._babylonGamepads; _i < _a.length; _i++) {
|
|
@@ -77795,6 +77854,9 @@ var BABYLON;
|
|
|
}
|
|
|
return null;
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Disposes the gamepad manager
|
|
|
+ */
|
|
|
GamepadManager.prototype.dispose = function () {
|
|
|
if (this._gamepadEventSupported) {
|
|
|
if (this._onGamepadConnectedEvent) {
|
|
@@ -77894,16 +77956,57 @@ var BABYLON;
|
|
|
|
|
|
var BABYLON;
|
|
|
(function (BABYLON) {
|
|
|
+ /**
|
|
|
+ * Represents a gamepad control stick position
|
|
|
+ */
|
|
|
var StickValues = /** @class */ (function () {
|
|
|
- function StickValues(x, y) {
|
|
|
+ /**
|
|
|
+ * Initializes the gamepad x and y control stick values
|
|
|
+ * @param x The x component of the gamepad control stick value
|
|
|
+ * @param y The y component of the gamepad control stick value
|
|
|
+ */
|
|
|
+ function StickValues(
|
|
|
+ /**
|
|
|
+ * The x component of the control stick
|
|
|
+ */
|
|
|
+ x,
|
|
|
+ /**
|
|
|
+ * The y component of the control stick
|
|
|
+ */
|
|
|
+ y) {
|
|
|
this.x = x;
|
|
|
this.y = y;
|
|
|
}
|
|
|
return StickValues;
|
|
|
}());
|
|
|
BABYLON.StickValues = StickValues;
|
|
|
+ /**
|
|
|
+ * Represents a gamepad
|
|
|
+ */
|
|
|
var Gamepad = /** @class */ (function () {
|
|
|
- function Gamepad(id, index, browserGamepad, leftStickX, leftStickY, rightStickX, rightStickY) {
|
|
|
+ /**
|
|
|
+ * Initializes the gamepad
|
|
|
+ * @param id The id of the gamepad
|
|
|
+ * @param index The index of the gamepad
|
|
|
+ * @param browserGamepad The browser gamepad
|
|
|
+ * @param leftStickX The x component of the left joystick
|
|
|
+ * @param leftStickY The y component of the left joystick
|
|
|
+ * @param rightStickX The x component of the right joystick
|
|
|
+ * @param rightStickY The y component of the right joystick
|
|
|
+ */
|
|
|
+ function Gamepad(
|
|
|
+ /**
|
|
|
+ * The id of the gamepad
|
|
|
+ */
|
|
|
+ id,
|
|
|
+ /**
|
|
|
+ * The index of the gamepad
|
|
|
+ */
|
|
|
+ index,
|
|
|
+ /**
|
|
|
+ * The browser gamepad
|
|
|
+ */
|
|
|
+ browserGamepad, leftStickX, leftStickY, rightStickX, rightStickY) {
|
|
|
if (leftStickX === void 0) { leftStickX = 0; }
|
|
|
if (leftStickY === void 0) { leftStickY = 1; }
|
|
|
if (rightStickX === void 0) { rightStickX = 2; }
|
|
@@ -77915,6 +78018,9 @@ var BABYLON;
|
|
|
this._rightStick = { x: 0, y: 0 };
|
|
|
/** @hidden */
|
|
|
this._isConnected = true;
|
|
|
+ /**
|
|
|
+ * Specifies whether the left control stick should be Y-inverted
|
|
|
+ */
|
|
|
this._invertLeftStickY = false;
|
|
|
this.type = Gamepad.GAMEPAD;
|
|
|
this._leftStickAxisX = leftStickX;
|
|
@@ -77929,22 +78035,39 @@ var BABYLON;
|
|
|
}
|
|
|
}
|
|
|
Object.defineProperty(Gamepad.prototype, "isConnected", {
|
|
|
+ /**
|
|
|
+ * Specifies if the gamepad has been connected
|
|
|
+ */
|
|
|
get: function () {
|
|
|
return this._isConnected;
|
|
|
},
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
|
});
|
|
|
+ /**
|
|
|
+ * Callback triggered when the left joystick has changed
|
|
|
+ * @param callback
|
|
|
+ */
|
|
|
Gamepad.prototype.onleftstickchanged = function (callback) {
|
|
|
this._onleftstickchanged = callback;
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Callback triggered when the right joystick has changed
|
|
|
+ * @param callback
|
|
|
+ */
|
|
|
Gamepad.prototype.onrightstickchanged = function (callback) {
|
|
|
this._onrightstickchanged = callback;
|
|
|
};
|
|
|
Object.defineProperty(Gamepad.prototype, "leftStick", {
|
|
|
+ /**
|
|
|
+ * Gets the left joystick
|
|
|
+ */
|
|
|
get: function () {
|
|
|
return this._leftStick;
|
|
|
},
|
|
|
+ /**
|
|
|
+ * Sets the left joystick values
|
|
|
+ */
|
|
|
set: function (newValues) {
|
|
|
if (this._onleftstickchanged && (this._leftStick.x !== newValues.x || this._leftStick.y !== newValues.y)) {
|
|
|
this._onleftstickchanged(newValues);
|
|
@@ -77955,9 +78078,15 @@ var BABYLON;
|
|
|
configurable: true
|
|
|
});
|
|
|
Object.defineProperty(Gamepad.prototype, "rightStick", {
|
|
|
+ /**
|
|
|
+ * Gets the right joystick
|
|
|
+ */
|
|
|
get: function () {
|
|
|
return this._rightStick;
|
|
|
},
|
|
|
+ /**
|
|
|
+ * Sets the right joystick value
|
|
|
+ */
|
|
|
set: function (newValues) {
|
|
|
if (this._onrightstickchanged && (this._rightStick.x !== newValues.x || this._rightStick.y !== newValues.y)) {
|
|
|
this._onrightstickchanged(newValues);
|
|
@@ -77967,6 +78096,9 @@ var BABYLON;
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
|
});
|
|
|
+ /**
|
|
|
+ * Updates the gamepad joystick positions
|
|
|
+ */
|
|
|
Gamepad.prototype.update = function () {
|
|
|
if (this._leftStick) {
|
|
|
this.leftStick = { x: this.browserGamepad.axes[this._leftStickAxisX], y: this.browserGamepad.axes[this._leftStickAxisY] };
|
|
@@ -77978,28 +78110,66 @@ var BABYLON;
|
|
|
this.rightStick = { x: this.browserGamepad.axes[this._rightStickAxisX], y: this.browserGamepad.axes[this._rightStickAxisY] };
|
|
|
}
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Disposes the gamepad
|
|
|
+ */
|
|
|
Gamepad.prototype.dispose = function () {
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Represents a gamepad controller
|
|
|
+ */
|
|
|
Gamepad.GAMEPAD = 0;
|
|
|
+ /**
|
|
|
+ * Represents a generic controller
|
|
|
+ */
|
|
|
Gamepad.GENERIC = 1;
|
|
|
+ /**
|
|
|
+ * Represents an XBox controller
|
|
|
+ */
|
|
|
Gamepad.XBOX = 2;
|
|
|
+ /**
|
|
|
+ * Represents a pose-enabled controller
|
|
|
+ */
|
|
|
Gamepad.POSE_ENABLED = 3;
|
|
|
return Gamepad;
|
|
|
}());
|
|
|
BABYLON.Gamepad = Gamepad;
|
|
|
+ /**
|
|
|
+ * Represents a generic gamepad
|
|
|
+ */
|
|
|
var GenericPad = /** @class */ (function (_super) {
|
|
|
__extends(GenericPad, _super);
|
|
|
+ /**
|
|
|
+ * Initializes the generic gamepad
|
|
|
+ * @param id The id of the generic gamepad
|
|
|
+ * @param index The index of the generic gamepad
|
|
|
+ * @param browserGamepad The browser gamepad
|
|
|
+ */
|
|
|
function GenericPad(id, index, browserGamepad) {
|
|
|
var _this = _super.call(this, id, index, browserGamepad) || this;
|
|
|
+ /**
|
|
|
+ * Observable triggered when a button has been pressed
|
|
|
+ */
|
|
|
_this.onButtonDownObservable = new BABYLON.Observable();
|
|
|
+ /**
|
|
|
+ * Observable triggered when a button has been released
|
|
|
+ */
|
|
|
_this.onButtonUpObservable = new BABYLON.Observable();
|
|
|
_this.type = Gamepad.GENERIC;
|
|
|
_this._buttons = new Array(browserGamepad.buttons.length);
|
|
|
return _this;
|
|
|
}
|
|
|
+ /**
|
|
|
+ * Callback triggered when a button has been pressed
|
|
|
+ * @param callback Called when a button has been pressed
|
|
|
+ */
|
|
|
GenericPad.prototype.onbuttondown = function (callback) {
|
|
|
this._onbuttondown = callback;
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Callback triggered when a button has been released
|
|
|
+ * @param callback Called when a button has been released
|
|
|
+ */
|
|
|
GenericPad.prototype.onbuttonup = function (callback) {
|
|
|
this._onbuttonup = callback;
|
|
|
};
|
|
@@ -78020,12 +78190,18 @@ var BABYLON;
|
|
|
}
|
|
|
return newValue;
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Updates the generic gamepad
|
|
|
+ */
|
|
|
GenericPad.prototype.update = function () {
|
|
|
_super.prototype.update.call(this);
|
|
|
for (var index = 0; index < this._buttons.length; index++) {
|
|
|
this._buttons[index] = this._setButtonValue(this.browserGamepad.buttons[index].value, this._buttons[index], index);
|
|
|
}
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Disposes the generic gamepad
|
|
|
+ */
|
|
|
GenericPad.prototype.dispose = function () {
|
|
|
_super.prototype.dispose.call(this);
|
|
|
this.onButtonDownObservable.clear();
|
|
@@ -78139,11 +78315,14 @@ var BABYLON;
|
|
|
};
|
|
|
Object.defineProperty(Xbox360Pad.prototype, "leftTrigger", {
|
|
|
/**
|
|
|
- * Gets or sets left trigger value
|
|
|
+ * Gets the left trigger value
|
|
|
*/
|
|
|
get: function () {
|
|
|
return this._leftTrigger;
|
|
|
},
|
|
|
+ /**
|
|
|
+ * Sets the left trigger value
|
|
|
+ */
|
|
|
set: function (newValue) {
|
|
|
if (this._onlefttriggerchanged && this._leftTrigger !== newValue) {
|
|
|
this._onlefttriggerchanged(newValue);
|
|
@@ -78155,11 +78334,14 @@ var BABYLON;
|
|
|
});
|
|
|
Object.defineProperty(Xbox360Pad.prototype, "rightTrigger", {
|
|
|
/**
|
|
|
- * Gets or sets right trigger value
|
|
|
+ * Gets the right trigger value
|
|
|
*/
|
|
|
get: function () {
|
|
|
return this._rightTrigger;
|
|
|
},
|
|
|
+ /**
|
|
|
+ * Sets the right trigger value
|
|
|
+ */
|
|
|
set: function (newValue) {
|
|
|
if (this._onrighttriggerchanged && this._rightTrigger !== newValue) {
|
|
|
this._onrighttriggerchanged(newValue);
|
|
@@ -78232,10 +78414,15 @@ var BABYLON;
|
|
|
return newValue;
|
|
|
};
|
|
|
Object.defineProperty(Xbox360Pad.prototype, "buttonA", {
|
|
|
- /** Gets or sets value of A button */
|
|
|
+ /**
|
|
|
+ * Gets the value of the `A` button
|
|
|
+ */
|
|
|
get: function () {
|
|
|
return this._buttonA;
|
|
|
},
|
|
|
+ /**
|
|
|
+ * Sets the value of the `A` button
|
|
|
+ */
|
|
|
set: function (value) {
|
|
|
this._buttonA = this._setButtonValue(value, this._buttonA, Xbox360Button.A);
|
|
|
},
|
|
@@ -78243,10 +78430,15 @@ var BABYLON;
|
|
|
configurable: true
|
|
|
});
|
|
|
Object.defineProperty(Xbox360Pad.prototype, "buttonB", {
|
|
|
- /** Gets or sets value of B button */
|
|
|
+ /**
|
|
|
+ * Gets the value of the `B` button
|
|
|
+ */
|
|
|
get: function () {
|
|
|
return this._buttonB;
|
|
|
},
|
|
|
+ /**
|
|
|
+ * Sets the value of the `B` button
|
|
|
+ */
|
|
|
set: function (value) {
|
|
|
this._buttonB = this._setButtonValue(value, this._buttonB, Xbox360Button.B);
|
|
|
},
|
|
@@ -78254,10 +78446,15 @@ var BABYLON;
|
|
|
configurable: true
|
|
|
});
|
|
|
Object.defineProperty(Xbox360Pad.prototype, "buttonX", {
|
|
|
- /** Gets or sets value of X button */
|
|
|
+ /**
|
|
|
+ * Gets the value of the `X` button
|
|
|
+ */
|
|
|
get: function () {
|
|
|
return this._buttonX;
|
|
|
},
|
|
|
+ /**
|
|
|
+ * Sets the value of the `X` button
|
|
|
+ */
|
|
|
set: function (value) {
|
|
|
this._buttonX = this._setButtonValue(value, this._buttonX, Xbox360Button.X);
|
|
|
},
|
|
@@ -78265,10 +78462,15 @@ var BABYLON;
|
|
|
configurable: true
|
|
|
});
|
|
|
Object.defineProperty(Xbox360Pad.prototype, "buttonY", {
|
|
|
- /** Gets or sets value of Y button */
|
|
|
+ /**
|
|
|
+ * Gets the value of the `Y` button
|
|
|
+ */
|
|
|
get: function () {
|
|
|
return this._buttonY;
|
|
|
},
|
|
|
+ /**
|
|
|
+ * Sets the value of the `Y` button
|
|
|
+ */
|
|
|
set: function (value) {
|
|
|
this._buttonY = this._setButtonValue(value, this._buttonY, Xbox360Button.Y);
|
|
|
},
|
|
@@ -78276,10 +78478,15 @@ var BABYLON;
|
|
|
configurable: true
|
|
|
});
|
|
|
Object.defineProperty(Xbox360Pad.prototype, "buttonStart", {
|
|
|
- /** Gets or sets value of Start button */
|
|
|
+ /**
|
|
|
+ * Gets the value of the `Start` button
|
|
|
+ */
|
|
|
get: function () {
|
|
|
return this._buttonStart;
|
|
|
},
|
|
|
+ /**
|
|
|
+ * Sets the value of the `Start` button
|
|
|
+ */
|
|
|
set: function (value) {
|
|
|
this._buttonStart = this._setButtonValue(value, this._buttonStart, Xbox360Button.Start);
|
|
|
},
|
|
@@ -78287,10 +78494,15 @@ var BABYLON;
|
|
|
configurable: true
|
|
|
});
|
|
|
Object.defineProperty(Xbox360Pad.prototype, "buttonBack", {
|
|
|
- /** Gets or sets value of Back button */
|
|
|
+ /**
|
|
|
+ * Gets the value of the `Back` button
|
|
|
+ */
|
|
|
get: function () {
|
|
|
return this._buttonBack;
|
|
|
},
|
|
|
+ /**
|
|
|
+ * Sets the value of the `Back` button
|
|
|
+ */
|
|
|
set: function (value) {
|
|
|
this._buttonBack = this._setButtonValue(value, this._buttonBack, Xbox360Button.Back);
|
|
|
},
|
|
@@ -78298,10 +78510,15 @@ var BABYLON;
|
|
|
configurable: true
|
|
|
});
|
|
|
Object.defineProperty(Xbox360Pad.prototype, "buttonLB", {
|
|
|
- /** Gets or sets value of Left button */
|
|
|
+ /**
|
|
|
+ * Gets the value of the `Left` button
|
|
|
+ */
|
|
|
get: function () {
|
|
|
return this._buttonLB;
|
|
|
},
|
|
|
+ /**
|
|
|
+ * Sets the value of the `Left` button
|
|
|
+ */
|
|
|
set: function (value) {
|
|
|
this._buttonLB = this._setButtonValue(value, this._buttonLB, Xbox360Button.LB);
|
|
|
},
|
|
@@ -78309,10 +78526,15 @@ var BABYLON;
|
|
|
configurable: true
|
|
|
});
|
|
|
Object.defineProperty(Xbox360Pad.prototype, "buttonRB", {
|
|
|
- /** Gets or sets value of Right button */
|
|
|
+ /**
|
|
|
+ * Gets the value of the `Right` button
|
|
|
+ */
|
|
|
get: function () {
|
|
|
return this._buttonRB;
|
|
|
},
|
|
|
+ /**
|
|
|
+ * Sets the value of the `Right` button
|
|
|
+ */
|
|
|
set: function (value) {
|
|
|
this._buttonRB = this._setButtonValue(value, this._buttonRB, Xbox360Button.RB);
|
|
|
},
|
|
@@ -78320,10 +78542,15 @@ var BABYLON;
|
|
|
configurable: true
|
|
|
});
|
|
|
Object.defineProperty(Xbox360Pad.prototype, "buttonLeftStick", {
|
|
|
- /** Gets or sets value of left stick */
|
|
|
+ /**
|
|
|
+ * Gets the value of the Left joystick
|
|
|
+ */
|
|
|
get: function () {
|
|
|
return this._buttonLeftStick;
|
|
|
},
|
|
|
+ /**
|
|
|
+ * Sets the value of the Left joystick
|
|
|
+ */
|
|
|
set: function (value) {
|
|
|
this._buttonLeftStick = this._setButtonValue(value, this._buttonLeftStick, Xbox360Button.LeftStick);
|
|
|
},
|
|
@@ -78331,10 +78558,15 @@ var BABYLON;
|
|
|
configurable: true
|
|
|
});
|
|
|
Object.defineProperty(Xbox360Pad.prototype, "buttonRightStick", {
|
|
|
- /** Gets or sets value of right stick */
|
|
|
+ /**
|
|
|
+ * Gets the value of the Right joystick
|
|
|
+ */
|
|
|
get: function () {
|
|
|
return this._buttonRightStick;
|
|
|
},
|
|
|
+ /**
|
|
|
+ * Sets the value of the Right joystick
|
|
|
+ */
|
|
|
set: function (value) {
|
|
|
this._buttonRightStick = this._setButtonValue(value, this._buttonRightStick, Xbox360Button.RightStick);
|
|
|
},
|
|
@@ -78342,10 +78574,15 @@ var BABYLON;
|
|
|
configurable: true
|
|
|
});
|
|
|
Object.defineProperty(Xbox360Pad.prototype, "dPadUp", {
|
|
|
- /** Gets or sets value of DPad up */
|
|
|
+ /**
|
|
|
+ * Gets the value of D-pad up
|
|
|
+ */
|
|
|
get: function () {
|
|
|
return this._dPadUp;
|
|
|
},
|
|
|
+ /**
|
|
|
+ * Sets the value of D-pad up
|
|
|
+ */
|
|
|
set: function (value) {
|
|
|
this._dPadUp = this._setDPadValue(value, this._dPadUp, Xbox360Dpad.Up);
|
|
|
},
|
|
@@ -78353,10 +78590,15 @@ var BABYLON;
|
|
|
configurable: true
|
|
|
});
|
|
|
Object.defineProperty(Xbox360Pad.prototype, "dPadDown", {
|
|
|
- /** Gets or sets value of DPad down */
|
|
|
+ /**
|
|
|
+ * Gets the value of D-pad down
|
|
|
+ */
|
|
|
get: function () {
|
|
|
return this._dPadDown;
|
|
|
},
|
|
|
+ /**
|
|
|
+ * Sets the value of D-pad down
|
|
|
+ */
|
|
|
set: function (value) {
|
|
|
this._dPadDown = this._setDPadValue(value, this._dPadDown, Xbox360Dpad.Down);
|
|
|
},
|
|
@@ -78364,10 +78606,15 @@ var BABYLON;
|
|
|
configurable: true
|
|
|
});
|
|
|
Object.defineProperty(Xbox360Pad.prototype, "dPadLeft", {
|
|
|
- /** Gets or sets value of DPad left */
|
|
|
+ /**
|
|
|
+ * Gets the value of D-pad left
|
|
|
+ */
|
|
|
get: function () {
|
|
|
return this._dPadLeft;
|
|
|
},
|
|
|
+ /**
|
|
|
+ * Sets the value of D-pad left
|
|
|
+ */
|
|
|
set: function (value) {
|
|
|
this._dPadLeft = this._setDPadValue(value, this._dPadLeft, Xbox360Dpad.Left);
|
|
|
},
|
|
@@ -78375,10 +78622,15 @@ var BABYLON;
|
|
|
configurable: true
|
|
|
});
|
|
|
Object.defineProperty(Xbox360Pad.prototype, "dPadRight", {
|
|
|
- /** Gets or sets value of DPad right */
|
|
|
+ /**
|
|
|
+ * Gets the value of D-pad right
|
|
|
+ */
|
|
|
get: function () {
|
|
|
return this._dPadRight;
|
|
|
},
|
|
|
+ /**
|
|
|
+ * Sets the value of D-pad right
|
|
|
+ */
|
|
|
set: function (value) {
|
|
|
this._dPadRight = this._setDPadValue(value, this._dPadRight, Xbox360Dpad.Right);
|
|
|
},
|
|
@@ -78427,6 +78679,9 @@ var BABYLON;
|
|
|
this.dPadRight = this.browserGamepad.buttons[15].value;
|
|
|
}
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Disposes the gamepad
|
|
|
+ */
|
|
|
Xbox360Pad.prototype.dispose = function () {
|
|
|
_super.prototype.dispose.call(this);
|
|
|
this.onButtonDownObservable.clear();
|
|
@@ -79861,10 +80116,16 @@ var BABYLON;
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
|
});
|
|
|
+ /**
|
|
|
+ * Adds a gamepad to the free camera inputs manager
|
|
|
+ */
|
|
|
BABYLON.FreeCameraInputsManager.prototype.addGamepad = function () {
|
|
|
this.add(new BABYLON.FreeCameraGamepadInput());
|
|
|
return this;
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Adds a gamepad to the arc rotate camera inputs manager
|
|
|
+ */
|
|
|
BABYLON.ArcRotateCameraInputsManager.prototype.addGamepad = function () {
|
|
|
this.add(new BABYLON.ArcRotateCameraGamepadInput());
|
|
|
return this;
|
|
@@ -90914,19 +91175,61 @@ var BABYLON;
|
|
|
|
|
|
var BABYLON;
|
|
|
(function (BABYLON) {
|
|
|
+ /**
|
|
|
+ * This represents one of the lens effect in a `BABYLON.lensFlareSystem`.
|
|
|
+ * It controls one of the indiviual texture used in the effect.
|
|
|
+ * @see http://doc.babylonjs.com/how_to/how_to_use_lens_flares
|
|
|
+ */
|
|
|
var LensFlare = /** @class */ (function () {
|
|
|
- function LensFlare(size, position, color, imgUrl, system) {
|
|
|
+ /**
|
|
|
+ * Instantiates a new Lens Flare.
|
|
|
+ * This represents one of the lens effect in a `BABYLON.lensFlareSystem`.
|
|
|
+ * It controls one of the indiviual texture used in the effect.
|
|
|
+ * @see http://doc.babylonjs.com/how_to/how_to_use_lens_flares
|
|
|
+ * @param size Define the size of the lens flare in the system (a floating value between 0 and 1)
|
|
|
+ * @param position Define the position of the lens flare in the system. (a floating value between -1 and 1). A value of 0 is located on the emitter. A value greater than 0 is beyond the emitter and a value lesser than 0 is behind.
|
|
|
+ * @param color Define the lens color
|
|
|
+ * @param imgUrl Define the lens texture url
|
|
|
+ * @param system Define the `lensFlareSystem` this flare is part of
|
|
|
+ */
|
|
|
+ function LensFlare(
|
|
|
+ /**
|
|
|
+ * Define the size of the lens flare in the system (a floating value between 0 and 1)
|
|
|
+ */
|
|
|
+ size,
|
|
|
+ /**
|
|
|
+ * Define the position of the lens flare in the system. (a floating value between -1 and 1). A value of 0 is located on the emitter. A value greater than 0 is beyond the emitter and a value lesser than 0 is behind.
|
|
|
+ */
|
|
|
+ position, color, imgUrl, system) {
|
|
|
this.size = size;
|
|
|
this.position = position;
|
|
|
+ /**
|
|
|
+ * Define the alpha mode to render this particular lens.
|
|
|
+ */
|
|
|
this.alphaMode = BABYLON.Engine.ALPHA_ONEONE;
|
|
|
this.color = color || new BABYLON.Color3(1, 1, 1);
|
|
|
this.texture = imgUrl ? new BABYLON.Texture(imgUrl, system.getScene(), true) : null;
|
|
|
this._system = system;
|
|
|
system.lensFlares.push(this);
|
|
|
}
|
|
|
+ /**
|
|
|
+ * Creates a new Lens Flare.
|
|
|
+ * This represents one of the lens effect in a `BABYLON.lensFlareSystem`.
|
|
|
+ * It controls one of the indiviual texture used in the effect.
|
|
|
+ * @see http://doc.babylonjs.com/how_to/how_to_use_lens_flares
|
|
|
+ * @param size Define the size of the lens flare (a floating value between 0 and 1)
|
|
|
+ * @param position Define the position of the lens flare in the system. (a floating value between -1 and 1). A value of 0 is located on the emitter. A value greater than 0 is beyond the emitter and a value lesser than 0 is behind.
|
|
|
+ * @param color Define the lens color
|
|
|
+ * @param imgUrl Define the lens texture url
|
|
|
+ * @param system Define the `lensFlareSystem` this flare is part of
|
|
|
+ * @returns The newly created Lens Flare
|
|
|
+ */
|
|
|
LensFlare.AddFlare = function (size, position, color, imgUrl, system) {
|
|
|
return new LensFlare(size, position, color, imgUrl, system);
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Dispose and release the lens flare with its associated resources.
|
|
|
+ */
|
|
|
LensFlare.prototype.dispose = function () {
|
|
|
if (this.texture) {
|
|
|
this.texture.dispose();
|
|
@@ -91086,12 +91389,42 @@ var BABYLON;
|
|
|
|
|
|
var BABYLON;
|
|
|
(function (BABYLON) {
|
|
|
+ /**
|
|
|
+ * This represents a Lens Flare System or the shiny effect created by the light reflection on the camera lenses.
|
|
|
+ * It is usually composed of several `BABYLON.lensFlare`.
|
|
|
+ * @see http://doc.babylonjs.com/how_to/how_to_use_lens_flares
|
|
|
+ */
|
|
|
var LensFlareSystem = /** @class */ (function () {
|
|
|
- function LensFlareSystem(name, emitter, scene) {
|
|
|
+ /**
|
|
|
+ * Instantiates a lens flare system.
|
|
|
+ * This represents a Lens Flare System or the shiny effect created by the light reflection on the camera lenses.
|
|
|
+ * It is usually composed of several `BABYLON.lensFlare`.
|
|
|
+ * @see http://doc.babylonjs.com/how_to/how_to_use_lens_flares
|
|
|
+ * @param name Define the name of the lens flare system in the scene
|
|
|
+ * @param emitter Define the source (the emitter) of the lens flares (it can be a camera, a light or a mesh).
|
|
|
+ * @param scene Define the scene the lens flare system belongs to
|
|
|
+ */
|
|
|
+ function LensFlareSystem(
|
|
|
+ /**
|
|
|
+ * Define the name of the lens flare system
|
|
|
+ */
|
|
|
+ name, emitter, scene) {
|
|
|
this.name = name;
|
|
|
+ /**
|
|
|
+ * List of lens flares used in this system.
|
|
|
+ */
|
|
|
this.lensFlares = new Array();
|
|
|
+ /**
|
|
|
+ * Define a limit from the border the lens flare can be visible.
|
|
|
+ */
|
|
|
this.borderLimit = 300;
|
|
|
+ /**
|
|
|
+ * Define a viewport border we do not want to see the lens flare in.
|
|
|
+ */
|
|
|
this.viewportBorder = 0;
|
|
|
+ /**
|
|
|
+ * Restricts the rendering of the effect to only the camera rendering this layer mask.
|
|
|
+ */
|
|
|
this.layerMask = 0x0FFFFFFF;
|
|
|
this._vertexBuffers = {};
|
|
|
this._isEnabled = true;
|
|
@@ -91126,6 +91459,9 @@ var BABYLON;
|
|
|
this._effect = engine.createEffect("lensFlare", [BABYLON.VertexBuffer.PositionKind], ["color", "viewportMatrix"], ["textureSampler"], "");
|
|
|
}
|
|
|
Object.defineProperty(LensFlareSystem.prototype, "isEnabled", {
|
|
|
+ /**
|
|
|
+ * Define if the lens flare system is enabled.
|
|
|
+ */
|
|
|
get: function () {
|
|
|
return this._isEnabled;
|
|
|
},
|
|
@@ -91135,18 +91471,40 @@ var BABYLON;
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
|
});
|
|
|
+ /**
|
|
|
+ * Get the scene the effects belongs to.
|
|
|
+ * @returns the scene holding the lens flare system
|
|
|
+ */
|
|
|
LensFlareSystem.prototype.getScene = function () {
|
|
|
return this._scene;
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Get the emitter of the lens flare system.
|
|
|
+ * It defines the source of the lens flares (it can be a camera, a light or a mesh).
|
|
|
+ * @returns the emitter of the lens flare system
|
|
|
+ */
|
|
|
LensFlareSystem.prototype.getEmitter = function () {
|
|
|
return this._emitter;
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Set the emitter of the lens flare system.
|
|
|
+ * It defines the source of the lens flares (it can be a camera, a light or a mesh).
|
|
|
+ * @param newEmitter Define the new emitter of the system
|
|
|
+ */
|
|
|
LensFlareSystem.prototype.setEmitter = function (newEmitter) {
|
|
|
this._emitter = newEmitter;
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Get the lens flare system emitter position.
|
|
|
+ * The emitter defines the source of the lens flares (it can be a camera, a light or a mesh).
|
|
|
+ * @returns the position
|
|
|
+ */
|
|
|
LensFlareSystem.prototype.getEmitterPosition = function () {
|
|
|
return this._emitter.getAbsolutePosition ? this._emitter.getAbsolutePosition() : this._emitter.position;
|
|
|
};
|
|
|
+ /**
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
LensFlareSystem.prototype.computeEffectivePosition = function (globalViewport) {
|
|
|
var position = this.getEmitterPosition();
|
|
|
position = BABYLON.Vector3.Project(position, BABYLON.Matrix.Identity(), this._scene.getTransformMatrix(), globalViewport);
|
|
@@ -91185,6 +91543,9 @@ var BABYLON;
|
|
|
var pickInfo = this._scene.pickWithRay(ray, this.meshesSelectionPredicate, true);
|
|
|
return !pickInfo || !pickInfo.hit || pickInfo.distance > distance;
|
|
|
};
|
|
|
+ /**
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
LensFlareSystem.prototype.render = function () {
|
|
|
if (!this._effect.isReady() || !this._scene.activeCamera)
|
|
|
return false;
|
|
@@ -91274,6 +91635,9 @@ var BABYLON;
|
|
|
engine.setAlphaMode(BABYLON.Engine.ALPHA_DISABLE);
|
|
|
return true;
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Dispose and release the lens flare with its associated resources.
|
|
|
+ */
|
|
|
LensFlareSystem.prototype.dispose = function () {
|
|
|
var vertexBuffer = this._vertexBuffers[BABYLON.VertexBuffer.PositionKind];
|
|
|
if (vertexBuffer) {
|
|
@@ -91291,6 +91655,13 @@ var BABYLON;
|
|
|
var index = this._scene.lensFlareSystems.indexOf(this);
|
|
|
this._scene.lensFlareSystems.splice(index, 1);
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Parse a lens flare system from a JSON repressentation
|
|
|
+ * @param parsedLensFlareSystem Define the JSON to parse
|
|
|
+ * @param scene Define the scene the parsed system should be instantiated in
|
|
|
+ * @param rootUrl Define the rootUrl of the load sequence to easily find a load relative dependencies such as textures
|
|
|
+ * @returns the parsed system
|
|
|
+ */
|
|
|
LensFlareSystem.Parse = function (parsedLensFlareSystem, scene, rootUrl) {
|
|
|
var emitter = scene.getLastEntryByID(parsedLensFlareSystem.emitterId);
|
|
|
var name = parsedLensFlareSystem.name || "lensFlareSystem#" + parsedLensFlareSystem.emitterId;
|
|
@@ -91303,6 +91674,10 @@ var BABYLON;
|
|
|
}
|
|
|
return lensFlareSystem;
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Serialize the current Lens Flare System into a JSON representation.
|
|
|
+ * @returns the serialized JSON
|
|
|
+ */
|
|
|
LensFlareSystem.prototype.serialize = function () {
|
|
|
var serializationObject = {};
|
|
|
serializationObject.id = this.id;
|
|
@@ -95812,6 +96187,7 @@ var BABYLON;
|
|
|
this.onPointerOutObservable = new BABYLON.Observable();
|
|
|
// Create scene which will be rendered in the foreground and remove it from being referenced by engine to avoid interfering with existing app
|
|
|
this.utilityLayerScene = new BABYLON.Scene(originalScene.getEngine());
|
|
|
+ this.utilityLayerScene.useRightHandedSystem = originalScene.useRightHandedSystem;
|
|
|
this.utilityLayerScene._allowPostProcessClearColor = false;
|
|
|
originalScene.getEngine().scenes.pop();
|
|
|
// Detach controls on utility scene, events will be fired by logic below to handle picking priority
|
|
@@ -108528,7 +108904,11 @@ var BABYLON;
|
|
|
* @param isBackground Defines whether the layer is displayed in front or behind the scene
|
|
|
* @param color Defines a color for the layer
|
|
|
*/
|
|
|
- function Layer(name, imgUrl, scene, isBackground, color) {
|
|
|
+ function Layer(
|
|
|
+ /**
|
|
|
+ * Define the name of the layer.
|
|
|
+ */
|
|
|
+ name, imgUrl, scene, isBackground, color) {
|
|
|
this.name = name;
|
|
|
/**
|
|
|
* Define the scale of the layer in order to zoom in out of the texture.
|
|
@@ -108612,6 +108992,10 @@ var BABYLON;
|
|
|
configurable: true
|
|
|
});
|
|
|
Object.defineProperty(Layer.prototype, "onAfterRender", {
|
|
|
+ /**
|
|
|
+ * Back compatibility with callback before the onAfterRenderObservable existed.
|
|
|
+ * The set callback will be triggered just after rendering the layer.
|
|
|
+ */
|
|
|
set: function (callback) {
|
|
|
if (this._onAfterRenderObserver) {
|
|
|
this.onAfterRenderObservable.remove(this._onAfterRenderObserver);
|
|
@@ -109114,7 +109498,7 @@ var BABYLON;
|
|
|
if (onAnimationEnd) {
|
|
|
onAnimationEnd();
|
|
|
}
|
|
|
- if (_this._attachedCamera) {
|
|
|
+ if (_this._attachedCamera && _this._attachedCamera.useInputToRestoreState) {
|
|
|
_this._attachedCamera.storeState();
|
|
|
}
|
|
|
});
|