|
@@ -13753,8 +13753,9 @@ var BaseCameraMouseWheelInput = /** @class */ (function () {
|
|
|
};
|
|
|
/**
|
|
|
* Detach the current controls from the specified dom element.
|
|
|
+ * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
|
|
|
*/
|
|
|
- BaseCameraMouseWheelInput.prototype.detachControl = function () {
|
|
|
+ BaseCameraMouseWheelInput.prototype.detachControl = function (ignored) {
|
|
|
if (this._observer) {
|
|
|
this.camera.getScene().onPointerObservable.remove(this._observer);
|
|
|
this._observer = null;
|
|
@@ -14012,8 +14013,9 @@ var BaseCameraPointersInput = /** @class */ (function () {
|
|
|
};
|
|
|
/**
|
|
|
* Detach the current controls from the specified dom element.
|
|
|
+ * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
|
|
|
*/
|
|
|
- BaseCameraPointersInput.prototype.detachControl = function () {
|
|
|
+ BaseCameraPointersInput.prototype.detachControl = function (ignored) {
|
|
|
if (this._onLostFocus) {
|
|
|
var hostWindow = this.camera.getScene().getEngine().getHostWindow();
|
|
|
if (hostWindow) {
|
|
@@ -14178,9 +14180,9 @@ var ArcRotateCameraGamepadInput = /** @class */ (function () {
|
|
|
};
|
|
|
/**
|
|
|
* Detach the current controls from the specified dom element.
|
|
|
- * @param element Defines the element to stop listening the inputs from
|
|
|
+ * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
|
|
|
*/
|
|
|
- ArcRotateCameraGamepadInput.prototype.detachControl = function () {
|
|
|
+ ArcRotateCameraGamepadInput.prototype.detachControl = function (ignored) {
|
|
|
this.camera.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver);
|
|
|
this.camera.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver);
|
|
|
this.gamepad = null;
|
|
@@ -14364,8 +14366,9 @@ var ArcRotateCameraKeyboardMoveInput = /** @class */ (function () {
|
|
|
};
|
|
|
/**
|
|
|
* Detach the current controls from the specified dom element.
|
|
|
+ * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
|
|
|
*/
|
|
|
- ArcRotateCameraKeyboardMoveInput.prototype.detachControl = function () {
|
|
|
+ ArcRotateCameraKeyboardMoveInput.prototype.detachControl = function (ignored) {
|
|
|
if (this._scene) {
|
|
|
if (this._onKeyboardObserver) {
|
|
|
this._scene.onKeyboardObservable.remove(this._onKeyboardObserver);
|
|
@@ -14585,8 +14588,9 @@ var ArcRotateCameraMouseWheelInput = /** @class */ (function () {
|
|
|
};
|
|
|
/**
|
|
|
* Detach the current controls from the specified dom element.
|
|
|
+ * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
|
|
|
*/
|
|
|
- ArcRotateCameraMouseWheelInput.prototype.detachControl = function () {
|
|
|
+ ArcRotateCameraMouseWheelInput.prototype.detachControl = function (ignored) {
|
|
|
if (this._observer) {
|
|
|
this.camera.getScene().onPointerObservable.remove(this._observer);
|
|
|
this._observer = null;
|
|
@@ -14966,8 +14970,9 @@ var ArcRotateCameraVRDeviceOrientationInput = /** @class */ (function () {
|
|
|
};
|
|
|
/**
|
|
|
* Detach the current controls from the specified dom element.
|
|
|
+ * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
|
|
|
*/
|
|
|
- ArcRotateCameraVRDeviceOrientationInput.prototype.detachControl = function () {
|
|
|
+ ArcRotateCameraVRDeviceOrientationInput.prototype.detachControl = function (ignored) {
|
|
|
window.removeEventListener("deviceorientation", this._deviceOrientationHandler);
|
|
|
};
|
|
|
/**
|
|
@@ -15099,8 +15104,9 @@ var FlyCameraKeyboardInput = /** @class */ (function () {
|
|
|
};
|
|
|
/**
|
|
|
* Detach the current controls from the specified dom element.
|
|
|
+ * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
|
|
|
*/
|
|
|
- FlyCameraKeyboardInput.prototype.detachControl = function () {
|
|
|
+ FlyCameraKeyboardInput.prototype.detachControl = function (ignored) {
|
|
|
if (this._scene) {
|
|
|
if (this._onKeyboardObserver) {
|
|
|
this._scene.onKeyboardObservable.remove(this._onKeyboardObserver);
|
|
@@ -15282,8 +15288,9 @@ var FlyCameraMouseInput = /** @class */ (function () {
|
|
|
};
|
|
|
/**
|
|
|
* Detach the current controls from the specified dom element.
|
|
|
+ * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
|
|
|
*/
|
|
|
- FlyCameraMouseInput.prototype.detachControl = function () {
|
|
|
+ FlyCameraMouseInput.prototype.detachControl = function (ignored) {
|
|
|
if (this._observer) {
|
|
|
this.camera.getScene().onPointerObservable.remove(this._observer);
|
|
|
this.camera.getScene().onBeforeRenderObservable.remove(this._rollObserver);
|
|
@@ -15625,8 +15632,9 @@ var FollowCameraKeyboardMoveInput = /** @class */ (function () {
|
|
|
};
|
|
|
/**
|
|
|
* Detach the current controls from the specified dom element.
|
|
|
+ * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
|
|
|
*/
|
|
|
- FollowCameraKeyboardMoveInput.prototype.detachControl = function () {
|
|
|
+ FollowCameraKeyboardMoveInput.prototype.detachControl = function (ignored) {
|
|
|
if (this._scene) {
|
|
|
if (this._onKeyboardObserver) {
|
|
|
this._scene.onKeyboardObservable.remove(this._onKeyboardObserver);
|
|
@@ -15895,8 +15903,9 @@ var FollowCameraMouseWheelInput = /** @class */ (function () {
|
|
|
};
|
|
|
/**
|
|
|
* Detach the current controls from the specified dom element.
|
|
|
+ * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
|
|
|
*/
|
|
|
- FollowCameraMouseWheelInput.prototype.detachControl = function () {
|
|
|
+ FollowCameraMouseWheelInput.prototype.detachControl = function (ignored) {
|
|
|
if (this._observer) {
|
|
|
this.camera.getScene().onPointerObservable.remove(this._observer);
|
|
|
this._observer = null;
|
|
@@ -16225,7 +16234,7 @@ var FreeCameraDeviceOrientationInput = /** @class */ (function () {
|
|
|
*/
|
|
|
this._onDeviceOrientationChangedObservable = new _Misc_observable__WEBPACK_IMPORTED_MODULE_4__["Observable"]();
|
|
|
this._orientationChanged = function () {
|
|
|
- _this._screenOrientationAngle = (window.orientation !== undefined ? +window.orientation : (window.screen.orientation && (window.screen.orientation)['angle'] ? (window.screen.orientation).angle : 0));
|
|
|
+ _this._screenOrientationAngle = window.orientation !== undefined ? +window.orientation : window.screen.orientation && window.screen.orientation["angle"] ? window.screen.orientation.angle : 0;
|
|
|
_this._screenOrientationAngle = -_Misc_tools__WEBPACK_IMPORTED_MODULE_2__["Tools"].ToRadians(_this._screenOrientationAngle / 2);
|
|
|
_this._screenQuaternion.copyFromFloats(0, Math.sin(_this._screenOrientationAngle), 0, Math.cos(_this._screenOrientationAngle));
|
|
|
};
|
|
@@ -16262,10 +16271,11 @@ var FreeCameraDeviceOrientationInput = /** @class */ (function () {
|
|
|
}
|
|
|
}, timeout);
|
|
|
}
|
|
|
- if (typeof (DeviceOrientationEvent) !== "undefined" && typeof DeviceOrientationEvent.requestPermission === 'function') {
|
|
|
- DeviceOrientationEvent.requestPermission()
|
|
|
+ if (typeof DeviceOrientationEvent !== "undefined" && typeof DeviceOrientationEvent.requestPermission === "function") {
|
|
|
+ DeviceOrientationEvent
|
|
|
+ .requestPermission()
|
|
|
.then(function (response) {
|
|
|
- if (response == 'granted') {
|
|
|
+ if (response == "granted") {
|
|
|
window.addEventListener("deviceorientation", eventHandler);
|
|
|
}
|
|
|
else {
|
|
@@ -16317,10 +16327,11 @@ var FreeCameraDeviceOrientationInput = /** @class */ (function () {
|
|
|
//So this is needed.
|
|
|
_this._orientationChanged();
|
|
|
};
|
|
|
- if (typeof (DeviceOrientationEvent) !== "undefined" && typeof DeviceOrientationEvent.requestPermission === 'function') {
|
|
|
- DeviceOrientationEvent.requestPermission()
|
|
|
+ if (typeof DeviceOrientationEvent !== "undefined" && typeof DeviceOrientationEvent.requestPermission === "function") {
|
|
|
+ DeviceOrientationEvent
|
|
|
+ .requestPermission()
|
|
|
.then(function (response) {
|
|
|
- if (response === 'granted') {
|
|
|
+ if (response === "granted") {
|
|
|
eventHandler_1();
|
|
|
}
|
|
|
else {
|
|
@@ -16338,8 +16349,9 @@ var FreeCameraDeviceOrientationInput = /** @class */ (function () {
|
|
|
};
|
|
|
/**
|
|
|
* Detach the current controls from the specified dom element.
|
|
|
+ * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
|
|
|
*/
|
|
|
- FreeCameraDeviceOrientationInput.prototype.detachControl = function () {
|
|
|
+ FreeCameraDeviceOrientationInput.prototype.detachControl = function (ignored) {
|
|
|
window.removeEventListener("orientationchange", this._orientationChanged);
|
|
|
window.removeEventListener("deviceorientation", this._deviceOrientation);
|
|
|
this._alpha = 0;
|
|
@@ -16466,8 +16478,9 @@ var FreeCameraGamepadInput = /** @class */ (function () {
|
|
|
};
|
|
|
/**
|
|
|
* Detach the current controls from the specified dom element.
|
|
|
+ * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
|
|
|
*/
|
|
|
- FreeCameraGamepadInput.prototype.detachControl = function () {
|
|
|
+ FreeCameraGamepadInput.prototype.detachControl = function (ignored) {
|
|
|
this.camera.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver);
|
|
|
this.camera.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver);
|
|
|
this.gamepad = null;
|
|
@@ -16609,12 +16622,7 @@ var FreeCameraKeyboardMoveInput = /** @class */ (function () {
|
|
|
var evt = info.event;
|
|
|
if (!evt.metaKey) {
|
|
|
if (info.type === _Events_keyboardEvents__WEBPACK_IMPORTED_MODULE_3__["KeyboardEventTypes"].KEYDOWN) {
|
|
|
- if (_this.keysUp.indexOf(evt.keyCode) !== -1 ||
|
|
|
- _this.keysDown.indexOf(evt.keyCode) !== -1 ||
|
|
|
- _this.keysLeft.indexOf(evt.keyCode) !== -1 ||
|
|
|
- _this.keysRight.indexOf(evt.keyCode) !== -1 ||
|
|
|
- _this.keysUpward.indexOf(evt.keyCode) !== -1 ||
|
|
|
- _this.keysDownward.indexOf(evt.keyCode) !== -1) {
|
|
|
+ if (_this.keysUp.indexOf(evt.keyCode) !== -1 || _this.keysDown.indexOf(evt.keyCode) !== -1 || _this.keysLeft.indexOf(evt.keyCode) !== -1 || _this.keysRight.indexOf(evt.keyCode) !== -1 || _this.keysUpward.indexOf(evt.keyCode) !== -1 || _this.keysDownward.indexOf(evt.keyCode) !== -1) {
|
|
|
var index = _this._keys.indexOf(evt.keyCode);
|
|
|
if (index === -1) {
|
|
|
_this._keys.push(evt.keyCode);
|
|
@@ -16625,12 +16633,7 @@ var FreeCameraKeyboardMoveInput = /** @class */ (function () {
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
- if (_this.keysUp.indexOf(evt.keyCode) !== -1 ||
|
|
|
- _this.keysDown.indexOf(evt.keyCode) !== -1 ||
|
|
|
- _this.keysLeft.indexOf(evt.keyCode) !== -1 ||
|
|
|
- _this.keysRight.indexOf(evt.keyCode) !== -1 ||
|
|
|
- _this.keysUpward.indexOf(evt.keyCode) !== -1 ||
|
|
|
- _this.keysDownward.indexOf(evt.keyCode) !== -1) {
|
|
|
+ if (_this.keysUp.indexOf(evt.keyCode) !== -1 || _this.keysDown.indexOf(evt.keyCode) !== -1 || _this.keysLeft.indexOf(evt.keyCode) !== -1 || _this.keysRight.indexOf(evt.keyCode) !== -1 || _this.keysUpward.indexOf(evt.keyCode) !== -1 || _this.keysDownward.indexOf(evt.keyCode) !== -1) {
|
|
|
var index = _this._keys.indexOf(evt.keyCode);
|
|
|
if (index >= 0) {
|
|
|
_this._keys.splice(index, 1);
|
|
@@ -16645,8 +16648,9 @@ var FreeCameraKeyboardMoveInput = /** @class */ (function () {
|
|
|
};
|
|
|
/**
|
|
|
* Detach the current controls from the specified dom element.
|
|
|
+ * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
|
|
|
*/
|
|
|
- FreeCameraKeyboardMoveInput.prototype.detachControl = function () {
|
|
|
+ FreeCameraKeyboardMoveInput.prototype.detachControl = function (ignored) {
|
|
|
if (this._scene) {
|
|
|
if (this._onKeyboardObserver) {
|
|
|
this._scene.onKeyboardObservable.remove(this._onKeyboardObserver);
|
|
@@ -16917,8 +16921,9 @@ var FreeCameraMouseInput = /** @class */ (function () {
|
|
|
};
|
|
|
/**
|
|
|
* Detach the current controls from the specified dom element.
|
|
|
+ * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
|
|
|
*/
|
|
|
- FreeCameraMouseInput.prototype.detachControl = function () {
|
|
|
+ FreeCameraMouseInput.prototype.detachControl = function (ignored) {
|
|
|
if (this._observer) {
|
|
|
this.camera.getScene().onPointerObservable.remove(this._observer);
|
|
|
if (this.onContextMenu) {
|
|
@@ -17514,9 +17519,9 @@ var FreeCameraTouchInput = /** @class */ (function () {
|
|
|
};
|
|
|
/**
|
|
|
* Detach the current controls from the specified dom element.
|
|
|
- * @param element Defines the element to stop listening the inputs from
|
|
|
+ * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
|
|
|
*/
|
|
|
- FreeCameraTouchInput.prototype.detachControl = function () {
|
|
|
+ FreeCameraTouchInput.prototype.detachControl = function (ignored) {
|
|
|
if (this._pointerInput) {
|
|
|
if (this._observer) {
|
|
|
this.camera.getScene().onPointerObservable.remove(this._observer);
|
|
@@ -17668,8 +17673,9 @@ var FreeCameraVirtualJoystickInput = /** @class */ (function () {
|
|
|
};
|
|
|
/**
|
|
|
* Detach the current controls from the specified dom element.
|
|
|
+ * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
|
|
|
*/
|
|
|
- FreeCameraVirtualJoystickInput.prototype.detachControl = function () {
|
|
|
+ FreeCameraVirtualJoystickInput.prototype.detachControl = function (ignored) {
|
|
|
this._leftjoystick.releaseCanvas();
|
|
|
this._rightjoystick.releaseCanvas();
|
|
|
};
|
|
@@ -21344,9 +21350,10 @@ var WebVRFreeCamera = /** @class */ (function (_super) {
|
|
|
}
|
|
|
};
|
|
|
/**
|
|
|
- * Detaches the camera from the html element and disables VR
|
|
|
+ * Detach the current controls from the specified dom element.
|
|
|
+ * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
|
|
|
*/
|
|
|
- WebVRFreeCamera.prototype.detachControl = function () {
|
|
|
+ WebVRFreeCamera.prototype.detachControl = function (ignored) {
|
|
|
this.getScene().gamepadManager.onGamepadConnectedObservable.remove(this._onGamepadConnectedObserver);
|
|
|
this.getScene().gamepadManager.onGamepadDisconnectedObservable.remove(this._onGamepadDisconnectedObserver);
|
|
|
_super.prototype.detachControl.call(this);
|
|
@@ -22344,13 +22351,16 @@ var ArcRotateCamera = /** @class */ (function (_super) {
|
|
|
if (useCtrlForPanning === void 0) { useCtrlForPanning = true; }
|
|
|
if (panningMouseButton === void 0) { panningMouseButton = 2; }
|
|
|
noPreventDefault = _Misc_tools__WEBPACK_IMPORTED_MODULE_13__["Tools"].BackCompatCameraNoPreventDefault(arguments);
|
|
|
+ this._useCtrlForPanning = useCtrlForPanning;
|
|
|
+ this._panningMouseButton = panningMouseButton;
|
|
|
+ // backwards compatibility
|
|
|
if (typeof arguments[0] === "boolean") {
|
|
|
- this._useCtrlForPanning = arguments[1];
|
|
|
- this._panningMouseButton = arguments[2];
|
|
|
- }
|
|
|
- else {
|
|
|
- this._useCtrlForPanning = useCtrlForPanning;
|
|
|
- this._panningMouseButton = panningMouseButton;
|
|
|
+ if (arguments.length > 1) {
|
|
|
+ this._useCtrlForPanning = arguments[1];
|
|
|
+ }
|
|
|
+ if (arguments.length > 2) {
|
|
|
+ this._panningMouseButton = arguments[2];
|
|
|
+ }
|
|
|
}
|
|
|
this.inputs.attachElement(noPreventDefault);
|
|
|
this._reset = function () {
|
|
@@ -22362,10 +22372,10 @@ var ArcRotateCamera = /** @class */ (function (_super) {
|
|
|
};
|
|
|
};
|
|
|
/**
|
|
|
- * Detach the current controls from the camera.
|
|
|
- * The camera will stop reacting to inputs.
|
|
|
+ * Detach the current controls from the specified dom element.
|
|
|
+ * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
|
|
|
*/
|
|
|
- ArcRotateCamera.prototype.detachControl = function () {
|
|
|
+ ArcRotateCamera.prototype.detachControl = function (ignored) {
|
|
|
this.inputs.detachElement();
|
|
|
if (this._reset) {
|
|
|
this._reset();
|
|
@@ -23226,8 +23236,9 @@ var Camera = /** @class */ (function (_super) {
|
|
|
};
|
|
|
/**
|
|
|
* Detach the current controls from the specified dom element.
|
|
|
+ * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
|
|
|
*/
|
|
|
- Camera.prototype.detachControl = function () {
|
|
|
+ Camera.prototype.detachControl = function (ignored) {
|
|
|
};
|
|
|
/**
|
|
|
* Update the camera state according to the different inputs gathered during the frame.
|
|
@@ -24684,10 +24695,11 @@ var FlyCamera = /** @class */ (function (_super) {
|
|
|
configurable: true
|
|
|
});
|
|
|
/**
|
|
|
- * Attach a control to the HTML DOM element.
|
|
|
- * @param noPreventDefault Defines whether events caught by the controls should call preventdefault(). https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault
|
|
|
+ * Attached controls to the current camera.
|
|
|
+ * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
|
|
|
+ * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
|
|
|
*/
|
|
|
- FlyCamera.prototype.attachControl = function (noPreventDefault) {
|
|
|
+ FlyCamera.prototype.attachControl = function (ignored, noPreventDefault) {
|
|
|
noPreventDefault = _Misc_tools__WEBPACK_IMPORTED_MODULE_6__["Tools"].BackCompatCameraNoPreventDefault(arguments);
|
|
|
this.inputs.attachElement(noPreventDefault);
|
|
|
};
|
|
@@ -25019,19 +25031,20 @@ var FollowCamera = /** @class */ (function (_super) {
|
|
|
};
|
|
|
/**
|
|
|
* Attached controls to the current camera.
|
|
|
+ * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
|
|
|
* @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
|
|
|
*/
|
|
|
- FollowCamera.prototype.attachControl = function (noPreventDefault) {
|
|
|
+ FollowCamera.prototype.attachControl = function (ignored, noPreventDefault) {
|
|
|
noPreventDefault = _Misc_tools__WEBPACK_IMPORTED_MODULE_2__["Tools"].BackCompatCameraNoPreventDefault(arguments);
|
|
|
this.inputs.attachElement(noPreventDefault);
|
|
|
this._reset = function () {
|
|
|
};
|
|
|
};
|
|
|
/**
|
|
|
- * Detach the current controls from the camera.
|
|
|
- * The camera will stop reacting to inputs.
|
|
|
+ * Detach the current controls from the specified dom element.
|
|
|
+ * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
|
|
|
*/
|
|
|
- FollowCamera.prototype.detachControl = function () {
|
|
|
+ FollowCamera.prototype.detachControl = function (ignored) {
|
|
|
this.inputs.detachElement();
|
|
|
if (this._reset) {
|
|
|
this._reset();
|
|
@@ -25489,17 +25502,18 @@ var FreeCamera = /** @class */ (function (_super) {
|
|
|
});
|
|
|
/**
|
|
|
* Attached controls to the current camera.
|
|
|
+ * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
|
|
|
* @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
|
|
|
*/
|
|
|
- FreeCamera.prototype.attachControl = function (noPreventDefault) {
|
|
|
+ FreeCamera.prototype.attachControl = function (ignored, noPreventDefault) {
|
|
|
noPreventDefault = _Misc_tools__WEBPACK_IMPORTED_MODULE_6__["Tools"].BackCompatCameraNoPreventDefault(arguments);
|
|
|
this.inputs.attachElement(noPreventDefault);
|
|
|
};
|
|
|
/**
|
|
|
- * Detach the current controls from the camera.
|
|
|
- * The camera will stop reacting to inputs.
|
|
|
+ * Detach the current controls from the specified dom element.
|
|
|
+ * @param ignored defines an ignored parameter kept for backward compatibility. If you want to define the source input element, you can set engine.inputElement before calling camera.attachControl
|
|
|
*/
|
|
|
- FreeCamera.prototype.detachControl = function () {
|
|
|
+ FreeCamera.prototype.detachControl = function (ignored) {
|
|
|
this.inputs.detachElement();
|
|
|
this.cameraDirection = new _Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__["Vector3"](0, 0, 0);
|
|
|
this.cameraRotation = new _Maths_math_vector__WEBPACK_IMPORTED_MODULE_2__["Vector2"](0, 0);
|
|
@@ -76914,7 +76928,7 @@ var LerpBlock = /** @class */ (function (_super) {
|
|
|
_this.registerOutput("output", _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_2__["NodeMaterialBlockConnectionPointTypes"].BasedOnInput);
|
|
|
_this._outputs[0]._typeConnectionSource = _this._inputs[0];
|
|
|
_this._linkConnectionTypes(0, 1);
|
|
|
- _this._linkConnectionTypes(1, 2);
|
|
|
+ _this._linkConnectionTypes(1, 2, true);
|
|
|
_this._inputs[2].acceptedConnectionPointTypes.push(_Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_2__["NodeMaterialBlockConnectionPointTypes"].Float);
|
|
|
return _this;
|
|
|
}
|
|
@@ -77368,10 +77382,12 @@ var NLerpBlock = /** @class */ (function (_super) {
|
|
|
var _this = _super.call(this, name, _Enums_nodeMaterialBlockTargets__WEBPACK_IMPORTED_MODULE_3__["NodeMaterialBlockTargets"].Neutral) || this;
|
|
|
_this.registerInput("left", _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_2__["NodeMaterialBlockConnectionPointTypes"].AutoDetect);
|
|
|
_this.registerInput("right", _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_2__["NodeMaterialBlockConnectionPointTypes"].AutoDetect);
|
|
|
- _this.registerInput("gradient", _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_2__["NodeMaterialBlockConnectionPointTypes"].Float);
|
|
|
+ _this.registerInput("gradient", _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_2__["NodeMaterialBlockConnectionPointTypes"].AutoDetect);
|
|
|
_this.registerOutput("output", _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_2__["NodeMaterialBlockConnectionPointTypes"].BasedOnInput);
|
|
|
_this._outputs[0]._typeConnectionSource = _this._inputs[0];
|
|
|
_this._linkConnectionTypes(0, 1);
|
|
|
+ _this._linkConnectionTypes(1, 2, true);
|
|
|
+ _this._inputs[2].acceptedConnectionPointTypes.push(_Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_2__["NodeMaterialBlockConnectionPointTypes"].Float);
|
|
|
return _this;
|
|
|
}
|
|
|
/**
|
|
@@ -83022,8 +83038,14 @@ var NodeMaterialBlock = /** @class */ (function () {
|
|
|
if (useInstances === void 0) { useInstances = false; }
|
|
|
return true;
|
|
|
};
|
|
|
- NodeMaterialBlock.prototype._linkConnectionTypes = function (inputIndex0, inputIndex1) {
|
|
|
- this._inputs[inputIndex0]._linkedConnectionSource = this._inputs[inputIndex1];
|
|
|
+ NodeMaterialBlock.prototype._linkConnectionTypes = function (inputIndex0, inputIndex1, looseCoupling) {
|
|
|
+ if (looseCoupling === void 0) { looseCoupling = false; }
|
|
|
+ if (looseCoupling) {
|
|
|
+ this._inputs[inputIndex1]._acceptedConnectionPointType = this._inputs[inputIndex0];
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this._inputs[inputIndex0]._linkedConnectionSource = this._inputs[inputIndex1];
|
|
|
+ }
|
|
|
this._inputs[inputIndex1]._linkedConnectionSource = this._inputs[inputIndex0];
|
|
|
};
|
|
|
NodeMaterialBlock.prototype._processBuild = function (block, state, input, activeBlocks) {
|
|
@@ -83390,6 +83412,8 @@ var NodeMaterialConnectionPoint = /** @class */ (function () {
|
|
|
this._typeConnectionSource = null;
|
|
|
/** @hidden */
|
|
|
this._linkedConnectionSource = null;
|
|
|
+ /** @hidden */
|
|
|
+ this._acceptedConnectionPointType = null;
|
|
|
this._type = _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_0__["NodeMaterialBlockConnectionPointTypes"].Float;
|
|
|
/** @hidden */
|
|
|
this._enforceAssociatedVariableName = false;
|
|
@@ -83422,6 +83446,41 @@ var NodeMaterialConnectionPoint = /** @class */ (function () {
|
|
|
this.name = name;
|
|
|
this._direction = direction;
|
|
|
}
|
|
|
+ /**
|
|
|
+ * Checks if two types are equivalent
|
|
|
+ * @param type1 type 1 to check
|
|
|
+ * @param type2 type 2 to check
|
|
|
+ * @returns true if both types are equivalent, else false
|
|
|
+ */
|
|
|
+ NodeMaterialConnectionPoint.AreEquivalentTypes = function (type1, type2) {
|
|
|
+ switch (type1) {
|
|
|
+ case _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_0__["NodeMaterialBlockConnectionPointTypes"].Vector3: {
|
|
|
+ if (type2 === _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_0__["NodeMaterialBlockConnectionPointTypes"].Color3) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_0__["NodeMaterialBlockConnectionPointTypes"].Vector4: {
|
|
|
+ if (type2 === _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_0__["NodeMaterialBlockConnectionPointTypes"].Color4) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_0__["NodeMaterialBlockConnectionPointTypes"].Color3: {
|
|
|
+ if (type2 === _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_0__["NodeMaterialBlockConnectionPointTypes"].Vector3) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_0__["NodeMaterialBlockConnectionPointTypes"].Color4: {
|
|
|
+ if (type2 === _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_0__["NodeMaterialBlockConnectionPointTypes"].Vector4) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ };
|
|
|
Object.defineProperty(NodeMaterialConnectionPoint.prototype, "direction", {
|
|
|
/** Gets the direction of the point */
|
|
|
get: function () {
|
|
@@ -83692,34 +83751,12 @@ var NodeMaterialConnectionPoint = /** @class */ (function () {
|
|
|
}
|
|
|
if (this.type !== connectionPoint.type && connectionPoint.innerType !== _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_0__["NodeMaterialBlockConnectionPointTypes"].AutoDetect) {
|
|
|
// Equivalents
|
|
|
- switch (this.type) {
|
|
|
- case _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_0__["NodeMaterialBlockConnectionPointTypes"].Vector3: {
|
|
|
- if (connectionPoint.type === _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_0__["NodeMaterialBlockConnectionPointTypes"].Color3) {
|
|
|
- return NodeMaterialConnectionPointCompatibilityStates.Compatible;
|
|
|
- }
|
|
|
- break;
|
|
|
- }
|
|
|
- case _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_0__["NodeMaterialBlockConnectionPointTypes"].Vector4: {
|
|
|
- if (connectionPoint.type === _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_0__["NodeMaterialBlockConnectionPointTypes"].Color4) {
|
|
|
- return NodeMaterialConnectionPointCompatibilityStates.Compatible;
|
|
|
- }
|
|
|
- break;
|
|
|
- }
|
|
|
- case _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_0__["NodeMaterialBlockConnectionPointTypes"].Color3: {
|
|
|
- if (connectionPoint.type === _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_0__["NodeMaterialBlockConnectionPointTypes"].Vector3) {
|
|
|
- return NodeMaterialConnectionPointCompatibilityStates.Compatible;
|
|
|
- }
|
|
|
- break;
|
|
|
- }
|
|
|
- case _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_0__["NodeMaterialBlockConnectionPointTypes"].Color4: {
|
|
|
- if (connectionPoint.type === _Enums_nodeMaterialBlockConnectionPointTypes__WEBPACK_IMPORTED_MODULE_0__["NodeMaterialBlockConnectionPointTypes"].Vector4) {
|
|
|
- return NodeMaterialConnectionPointCompatibilityStates.Compatible;
|
|
|
- }
|
|
|
- break;
|
|
|
- }
|
|
|
+ if (NodeMaterialConnectionPoint.AreEquivalentTypes(this.type, connectionPoint.type)) {
|
|
|
+ return NodeMaterialConnectionPointCompatibilityStates.Compatible;
|
|
|
}
|
|
|
// Accepted types
|
|
|
- if (connectionPoint.acceptedConnectionPointTypes && connectionPoint.acceptedConnectionPointTypes.indexOf(this.type) !== -1) {
|
|
|
+ if (connectionPoint.acceptedConnectionPointTypes && connectionPoint.acceptedConnectionPointTypes.indexOf(this.type) !== -1 ||
|
|
|
+ connectionPoint._acceptedConnectionPointType && NodeMaterialConnectionPoint.AreEquivalentTypes(connectionPoint._acceptedConnectionPointType.type, this.type)) {
|
|
|
return NodeMaterialConnectionPointCompatibilityStates.Compatible;
|
|
|
}
|
|
|
else {
|
|
@@ -130841,7 +130878,7 @@ var Mesh = /** @class */ (function (_super) {
|
|
|
var currentIndices = vertex_data.indices;
|
|
|
var positions = vertex_data.positions;
|
|
|
var normals = vertex_data.normals;
|
|
|
- if (currentIndices === null || positions === null || normals === null || uvs === null) {
|
|
|
+ if (!currentIndices || !positions || !normals || !uvs) {
|
|
|
_Misc_logger__WEBPACK_IMPORTED_MODULE_19__["Logger"].Warn("VertexData contains null entries");
|
|
|
}
|
|
|
else {
|
|
@@ -169816,22 +169853,24 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultRenderingPipeline", function() { return DefaultRenderingPipeline; });
|
|
|
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../node_modules/tslib/tslib.es6.js");
|
|
|
/* harmony import */ var _Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../Misc/decorators */ "./Misc/decorators.ts");
|
|
|
-/* harmony import */ var _Misc_logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../Misc/logger */ "./Misc/logger.ts");
|
|
|
-/* harmony import */ var _Materials_Textures_texture__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../Materials/Textures/texture */ "./Materials/Textures/texture.ts");
|
|
|
-/* harmony import */ var _Engines_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../Engines/constants */ "./Engines/constants.ts");
|
|
|
-/* harmony import */ var _Layers_glowLayer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../Layers/glowLayer */ "./Layers/glowLayer.ts");
|
|
|
-/* harmony import */ var _PostProcesses_sharpenPostProcess__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../PostProcesses/sharpenPostProcess */ "./PostProcesses/sharpenPostProcess.ts");
|
|
|
-/* harmony import */ var _PostProcesses_imageProcessingPostProcess__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../PostProcesses/imageProcessingPostProcess */ "./PostProcesses/imageProcessingPostProcess.ts");
|
|
|
-/* harmony import */ var _PostProcesses_chromaticAberrationPostProcess__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../PostProcesses/chromaticAberrationPostProcess */ "./PostProcesses/chromaticAberrationPostProcess.ts");
|
|
|
-/* harmony import */ var _PostProcesses_grainPostProcess__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../PostProcesses/grainPostProcess */ "./PostProcesses/grainPostProcess.ts");
|
|
|
-/* harmony import */ var _PostProcesses_fxaaPostProcess__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../PostProcesses/fxaaPostProcess */ "./PostProcesses/fxaaPostProcess.ts");
|
|
|
-/* harmony import */ var _PostProcesses_RenderPipeline_postProcessRenderPipeline__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../PostProcesses/RenderPipeline/postProcessRenderPipeline */ "./PostProcesses/RenderPipeline/postProcessRenderPipeline.ts");
|
|
|
-/* harmony import */ var _PostProcesses_RenderPipeline_postProcessRenderEffect__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../PostProcesses/RenderPipeline/postProcessRenderEffect */ "./PostProcesses/RenderPipeline/postProcessRenderEffect.ts");
|
|
|
-/* harmony import */ var _PostProcesses_depthOfFieldEffect__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../PostProcesses/depthOfFieldEffect */ "./PostProcesses/depthOfFieldEffect.ts");
|
|
|
-/* harmony import */ var _PostProcesses_bloomEffect__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../PostProcesses/bloomEffect */ "./PostProcesses/bloomEffect.ts");
|
|
|
-/* harmony import */ var _Misc_typeStore__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../Misc/typeStore */ "./Misc/typeStore.ts");
|
|
|
-/* harmony import */ var _Engines_engineStore__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../Engines/engineStore */ "./Engines/engineStore.ts");
|
|
|
-/* harmony import */ var _PostProcesses_RenderPipeline_postProcessRenderPipelineManagerSceneComponent__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent */ "./PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent.ts");
|
|
|
+/* harmony import */ var _Misc_observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../Misc/observable */ "./Misc/observable.ts");
|
|
|
+/* harmony import */ var _Misc_logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../Misc/logger */ "./Misc/logger.ts");
|
|
|
+/* harmony import */ var _Materials_Textures_texture__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../Materials/Textures/texture */ "./Materials/Textures/texture.ts");
|
|
|
+/* harmony import */ var _Engines_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../Engines/constants */ "./Engines/constants.ts");
|
|
|
+/* harmony import */ var _Layers_glowLayer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../Layers/glowLayer */ "./Layers/glowLayer.ts");
|
|
|
+/* harmony import */ var _PostProcesses_sharpenPostProcess__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../PostProcesses/sharpenPostProcess */ "./PostProcesses/sharpenPostProcess.ts");
|
|
|
+/* harmony import */ var _PostProcesses_imageProcessingPostProcess__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../PostProcesses/imageProcessingPostProcess */ "./PostProcesses/imageProcessingPostProcess.ts");
|
|
|
+/* harmony import */ var _PostProcesses_chromaticAberrationPostProcess__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../PostProcesses/chromaticAberrationPostProcess */ "./PostProcesses/chromaticAberrationPostProcess.ts");
|
|
|
+/* harmony import */ var _PostProcesses_grainPostProcess__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../PostProcesses/grainPostProcess */ "./PostProcesses/grainPostProcess.ts");
|
|
|
+/* harmony import */ var _PostProcesses_fxaaPostProcess__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../PostProcesses/fxaaPostProcess */ "./PostProcesses/fxaaPostProcess.ts");
|
|
|
+/* harmony import */ var _PostProcesses_RenderPipeline_postProcessRenderPipeline__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../PostProcesses/RenderPipeline/postProcessRenderPipeline */ "./PostProcesses/RenderPipeline/postProcessRenderPipeline.ts");
|
|
|
+/* harmony import */ var _PostProcesses_RenderPipeline_postProcessRenderEffect__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../PostProcesses/RenderPipeline/postProcessRenderEffect */ "./PostProcesses/RenderPipeline/postProcessRenderEffect.ts");
|
|
|
+/* harmony import */ var _PostProcesses_depthOfFieldEffect__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../PostProcesses/depthOfFieldEffect */ "./PostProcesses/depthOfFieldEffect.ts");
|
|
|
+/* harmony import */ var _PostProcesses_bloomEffect__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../PostProcesses/bloomEffect */ "./PostProcesses/bloomEffect.ts");
|
|
|
+/* harmony import */ var _Misc_typeStore__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../Misc/typeStore */ "./Misc/typeStore.ts");
|
|
|
+/* harmony import */ var _Engines_engineStore__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../Engines/engineStore */ "./Engines/engineStore.ts");
|
|
|
+/* harmony import */ var _PostProcesses_RenderPipeline_postProcessRenderPipelineManagerSceneComponent__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent */ "./PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent.ts");
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -169867,7 +169906,7 @@ var DefaultRenderingPipeline = /** @class */ (function (_super) {
|
|
|
function DefaultRenderingPipeline(name, hdr, scene, cameras, automaticBuild) {
|
|
|
if (name === void 0) { name = ""; }
|
|
|
if (hdr === void 0) { hdr = true; }
|
|
|
- if (scene === void 0) { scene = _Engines_engineStore__WEBPACK_IMPORTED_MODULE_16__["EngineStore"].LastCreatedScene; }
|
|
|
+ if (scene === void 0) { scene = _Engines_engineStore__WEBPACK_IMPORTED_MODULE_17__["EngineStore"].LastCreatedScene; }
|
|
|
if (automaticBuild === void 0) { automaticBuild = true; }
|
|
|
var _this = _super.call(this, scene.getEngine(), name) || this;
|
|
|
_this._camerasToBeAttached = [];
|
|
@@ -169906,13 +169945,17 @@ var DefaultRenderingPipeline = /** @class */ (function (_super) {
|
|
|
_this._sharpenEnabled = false;
|
|
|
_this._bloomEnabled = false;
|
|
|
_this._depthOfFieldEnabled = false;
|
|
|
- _this._depthOfFieldBlurLevel = _PostProcesses_depthOfFieldEffect__WEBPACK_IMPORTED_MODULE_13__["DepthOfFieldEffectBlurLevel"].Low;
|
|
|
+ _this._depthOfFieldBlurLevel = _PostProcesses_depthOfFieldEffect__WEBPACK_IMPORTED_MODULE_14__["DepthOfFieldEffectBlurLevel"].Low;
|
|
|
_this._fxaaEnabled = false;
|
|
|
_this._imageProcessingEnabled = true;
|
|
|
_this._bloomScale = 0.5;
|
|
|
_this._chromaticAberrationEnabled = false;
|
|
|
_this._grainEnabled = false;
|
|
|
_this._buildAllowed = true;
|
|
|
+ /**
|
|
|
+ * This is triggered each time the pipeline has been built.
|
|
|
+ */
|
|
|
+ _this.onBuildObservable = new _Misc_observable__WEBPACK_IMPORTED_MODULE_2__["Observable"]();
|
|
|
_this._resizeObserver = null;
|
|
|
_this._hardwareScaleLevel = 1.0;
|
|
|
_this._bloomKernel = 64;
|
|
@@ -169940,28 +169983,28 @@ var DefaultRenderingPipeline = /** @class */ (function (_super) {
|
|
|
// Misc
|
|
|
if (_this._hdr) {
|
|
|
if (caps.textureHalfFloatRender) {
|
|
|
- _this._defaultPipelineTextureType = _Engines_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].TEXTURETYPE_HALF_FLOAT;
|
|
|
+ _this._defaultPipelineTextureType = _Engines_constants__WEBPACK_IMPORTED_MODULE_5__["Constants"].TEXTURETYPE_HALF_FLOAT;
|
|
|
}
|
|
|
else if (caps.textureFloatRender) {
|
|
|
- _this._defaultPipelineTextureType = _Engines_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].TEXTURETYPE_FLOAT;
|
|
|
+ _this._defaultPipelineTextureType = _Engines_constants__WEBPACK_IMPORTED_MODULE_5__["Constants"].TEXTURETYPE_FLOAT;
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
- _this._defaultPipelineTextureType = _Engines_constants__WEBPACK_IMPORTED_MODULE_4__["Constants"].TEXTURETYPE_UNSIGNED_INT;
|
|
|
+ _this._defaultPipelineTextureType = _Engines_constants__WEBPACK_IMPORTED_MODULE_5__["Constants"].TEXTURETYPE_UNSIGNED_INT;
|
|
|
}
|
|
|
// Attach
|
|
|
scene.postProcessRenderPipelineManager.addPipeline(_this);
|
|
|
var engine = _this._scene.getEngine();
|
|
|
// Create post processes before hand so they can be modified before enabled.
|
|
|
// Block compilation flag is set to true to avoid compilation prior to use, these will be updated on first use in build pipeline.
|
|
|
- _this.sharpen = new _PostProcesses_sharpenPostProcess__WEBPACK_IMPORTED_MODULE_6__["SharpenPostProcess"]("sharpen", 1.0, null, _Materials_Textures_texture__WEBPACK_IMPORTED_MODULE_3__["Texture"].BILINEAR_SAMPLINGMODE, engine, false, _this._defaultPipelineTextureType, true);
|
|
|
- _this._sharpenEffect = new _PostProcesses_RenderPipeline_postProcessRenderEffect__WEBPACK_IMPORTED_MODULE_12__["PostProcessRenderEffect"](engine, _this.SharpenPostProcessId, function () { return _this.sharpen; }, true);
|
|
|
- _this.depthOfField = new _PostProcesses_depthOfFieldEffect__WEBPACK_IMPORTED_MODULE_13__["DepthOfFieldEffect"](_this._scene, null, _this._depthOfFieldBlurLevel, _this._defaultPipelineTextureType, true);
|
|
|
- _this.bloom = new _PostProcesses_bloomEffect__WEBPACK_IMPORTED_MODULE_14__["BloomEffect"](_this._scene, _this._bloomScale, _this._bloomWeight, _this.bloomKernel, _this._defaultPipelineTextureType, true);
|
|
|
- _this.chromaticAberration = new _PostProcesses_chromaticAberrationPostProcess__WEBPACK_IMPORTED_MODULE_8__["ChromaticAberrationPostProcess"]("ChromaticAberration", engine.getRenderWidth(), engine.getRenderHeight(), 1.0, null, _Materials_Textures_texture__WEBPACK_IMPORTED_MODULE_3__["Texture"].BILINEAR_SAMPLINGMODE, engine, false, _this._defaultPipelineTextureType, true);
|
|
|
- _this._chromaticAberrationEffect = new _PostProcesses_RenderPipeline_postProcessRenderEffect__WEBPACK_IMPORTED_MODULE_12__["PostProcessRenderEffect"](engine, _this.ChromaticAberrationPostProcessId, function () { return _this.chromaticAberration; }, true);
|
|
|
- _this.grain = new _PostProcesses_grainPostProcess__WEBPACK_IMPORTED_MODULE_9__["GrainPostProcess"]("Grain", 1.0, null, _Materials_Textures_texture__WEBPACK_IMPORTED_MODULE_3__["Texture"].BILINEAR_SAMPLINGMODE, engine, false, _this._defaultPipelineTextureType, true);
|
|
|
- _this._grainEffect = new _PostProcesses_RenderPipeline_postProcessRenderEffect__WEBPACK_IMPORTED_MODULE_12__["PostProcessRenderEffect"](engine, _this.GrainPostProcessId, function () { return _this.grain; }, true);
|
|
|
+ _this.sharpen = new _PostProcesses_sharpenPostProcess__WEBPACK_IMPORTED_MODULE_7__["SharpenPostProcess"]("sharpen", 1.0, null, _Materials_Textures_texture__WEBPACK_IMPORTED_MODULE_4__["Texture"].BILINEAR_SAMPLINGMODE, engine, false, _this._defaultPipelineTextureType, true);
|
|
|
+ _this._sharpenEffect = new _PostProcesses_RenderPipeline_postProcessRenderEffect__WEBPACK_IMPORTED_MODULE_13__["PostProcessRenderEffect"](engine, _this.SharpenPostProcessId, function () { return _this.sharpen; }, true);
|
|
|
+ _this.depthOfField = new _PostProcesses_depthOfFieldEffect__WEBPACK_IMPORTED_MODULE_14__["DepthOfFieldEffect"](_this._scene, null, _this._depthOfFieldBlurLevel, _this._defaultPipelineTextureType, true);
|
|
|
+ _this.bloom = new _PostProcesses_bloomEffect__WEBPACK_IMPORTED_MODULE_15__["BloomEffect"](_this._scene, _this._bloomScale, _this._bloomWeight, _this.bloomKernel, _this._defaultPipelineTextureType, true);
|
|
|
+ _this.chromaticAberration = new _PostProcesses_chromaticAberrationPostProcess__WEBPACK_IMPORTED_MODULE_9__["ChromaticAberrationPostProcess"]("ChromaticAberration", engine.getRenderWidth(), engine.getRenderHeight(), 1.0, null, _Materials_Textures_texture__WEBPACK_IMPORTED_MODULE_4__["Texture"].BILINEAR_SAMPLINGMODE, engine, false, _this._defaultPipelineTextureType, true);
|
|
|
+ _this._chromaticAberrationEffect = new _PostProcesses_RenderPipeline_postProcessRenderEffect__WEBPACK_IMPORTED_MODULE_13__["PostProcessRenderEffect"](engine, _this.ChromaticAberrationPostProcessId, function () { return _this.chromaticAberration; }, true);
|
|
|
+ _this.grain = new _PostProcesses_grainPostProcess__WEBPACK_IMPORTED_MODULE_10__["GrainPostProcess"]("Grain", 1.0, null, _Materials_Textures_texture__WEBPACK_IMPORTED_MODULE_4__["Texture"].BILINEAR_SAMPLINGMODE, engine, false, _this._defaultPipelineTextureType, true);
|
|
|
+ _this._grainEffect = new _PostProcesses_RenderPipeline_postProcessRenderEffect__WEBPACK_IMPORTED_MODULE_13__["PostProcessRenderEffect"](engine, _this.GrainPostProcessId, function () { return _this.grain; }, true);
|
|
|
_this._resizeObserver = engine.onResizeObservable.add(function () {
|
|
|
_this._hardwareScaleLevel = engine.getHardwareScalingLevel();
|
|
|
_this.bloomKernel = _this.bloomKernel;
|
|
@@ -170090,7 +170133,7 @@ var DefaultRenderingPipeline = /** @class */ (function (_super) {
|
|
|
DefaultRenderingPipeline.prototype._rebuildBloom = function () {
|
|
|
// recreate bloom and dispose old as this setting is not dynamic
|
|
|
var oldBloom = this.bloom;
|
|
|
- this.bloom = new _PostProcesses_bloomEffect__WEBPACK_IMPORTED_MODULE_14__["BloomEffect"](this._scene, this.bloomScale, this._bloomWeight, this.bloomKernel, this._defaultPipelineTextureType, false);
|
|
|
+ this.bloom = new _PostProcesses_bloomEffect__WEBPACK_IMPORTED_MODULE_15__["BloomEffect"](this._scene, this.bloomScale, this._bloomWeight, this.bloomKernel, this._defaultPipelineTextureType, false);
|
|
|
this.bloom.threshold = oldBloom.threshold;
|
|
|
for (var i = 0; i < this._cameras.length; i++) {
|
|
|
oldBloom.disposeEffects(this._cameras[i]);
|
|
@@ -170127,7 +170170,7 @@ var DefaultRenderingPipeline = /** @class */ (function (_super) {
|
|
|
this._depthOfFieldBlurLevel = value;
|
|
|
// recreate dof and dispose old as this setting is not dynamic
|
|
|
var oldDof = this.depthOfField;
|
|
|
- this.depthOfField = new _PostProcesses_depthOfFieldEffect__WEBPACK_IMPORTED_MODULE_13__["DepthOfFieldEffect"](this._scene, null, this._depthOfFieldBlurLevel, this._defaultPipelineTextureType, false);
|
|
|
+ this.depthOfField = new _PostProcesses_depthOfFieldEffect__WEBPACK_IMPORTED_MODULE_14__["DepthOfFieldEffect"](this._scene, null, this._depthOfFieldBlurLevel, this._defaultPipelineTextureType, false);
|
|
|
this.depthOfField.focalLength = oldDof.focalLength;
|
|
|
this.depthOfField.focusDistance = oldDof.focusDistance;
|
|
|
this.depthOfField.fStop = oldDof.fStop;
|
|
@@ -170199,7 +170242,7 @@ var DefaultRenderingPipeline = /** @class */ (function (_super) {
|
|
|
*/
|
|
|
set: function (enabled) {
|
|
|
if (enabled && !this._glowLayer) {
|
|
|
- this._glowLayer = new _Layers_glowLayer__WEBPACK_IMPORTED_MODULE_5__["GlowLayer"]("", this._scene);
|
|
|
+ this._glowLayer = new _Layers_glowLayer__WEBPACK_IMPORTED_MODULE_6__["GlowLayer"]("", this._scene);
|
|
|
}
|
|
|
else if (!enabled && this._glowLayer) {
|
|
|
this._glowLayer.dispose();
|
|
@@ -170345,9 +170388,9 @@ var DefaultRenderingPipeline = /** @class */ (function (_super) {
|
|
|
this._setAutoClearAndTextureSharing(this.bloom._effects[0], true);
|
|
|
}
|
|
|
if (this._imageProcessingEnabled) {
|
|
|
- this.imageProcessing = new _PostProcesses_imageProcessingPostProcess__WEBPACK_IMPORTED_MODULE_7__["ImageProcessingPostProcess"]("imageProcessing", 1.0, null, _Materials_Textures_texture__WEBPACK_IMPORTED_MODULE_3__["Texture"].BILINEAR_SAMPLINGMODE, engine, false, this._defaultPipelineTextureType);
|
|
|
+ this.imageProcessing = new _PostProcesses_imageProcessingPostProcess__WEBPACK_IMPORTED_MODULE_8__["ImageProcessingPostProcess"]("imageProcessing", 1.0, null, _Materials_Textures_texture__WEBPACK_IMPORTED_MODULE_4__["Texture"].BILINEAR_SAMPLINGMODE, engine, false, this._defaultPipelineTextureType);
|
|
|
if (this._hdr) {
|
|
|
- this.addEffect(new _PostProcesses_RenderPipeline_postProcessRenderEffect__WEBPACK_IMPORTED_MODULE_12__["PostProcessRenderEffect"](engine, this.ImageProcessingPostProcessId, function () { return _this.imageProcessing; }, true));
|
|
|
+ this.addEffect(new _PostProcesses_RenderPipeline_postProcessRenderEffect__WEBPACK_IMPORTED_MODULE_13__["PostProcessRenderEffect"](engine, this.ImageProcessingPostProcessId, function () { return _this.imageProcessing; }, true));
|
|
|
this._setAutoClearAndTextureSharing(this.imageProcessing);
|
|
|
}
|
|
|
else {
|
|
@@ -170382,8 +170425,8 @@ var DefaultRenderingPipeline = /** @class */ (function (_super) {
|
|
|
this._setAutoClearAndTextureSharing(this.chromaticAberration);
|
|
|
}
|
|
|
if (this.fxaaEnabled) {
|
|
|
- this.fxaa = new _PostProcesses_fxaaPostProcess__WEBPACK_IMPORTED_MODULE_10__["FxaaPostProcess"]("fxaa", 1.0, null, _Materials_Textures_texture__WEBPACK_IMPORTED_MODULE_3__["Texture"].BILINEAR_SAMPLINGMODE, engine, false, this._defaultPipelineTextureType);
|
|
|
- this.addEffect(new _PostProcesses_RenderPipeline_postProcessRenderEffect__WEBPACK_IMPORTED_MODULE_12__["PostProcessRenderEffect"](engine, this.FxaaPostProcessId, function () { return _this.fxaa; }, true));
|
|
|
+ this.fxaa = new _PostProcesses_fxaaPostProcess__WEBPACK_IMPORTED_MODULE_11__["FxaaPostProcess"]("fxaa", 1.0, null, _Materials_Textures_texture__WEBPACK_IMPORTED_MODULE_4__["Texture"].BILINEAR_SAMPLINGMODE, engine, false, this._defaultPipelineTextureType);
|
|
|
+ this.addEffect(new _PostProcesses_RenderPipeline_postProcessRenderEffect__WEBPACK_IMPORTED_MODULE_13__["PostProcessRenderEffect"](engine, this.FxaaPostProcessId, function () { return _this.fxaa; }, true));
|
|
|
this._setAutoClearAndTextureSharing(this.fxaa, true);
|
|
|
}
|
|
|
if (this._cameras !== null) {
|
|
@@ -170394,8 +170437,9 @@ var DefaultRenderingPipeline = /** @class */ (function (_super) {
|
|
|
this._scene.autoClear = true;
|
|
|
}
|
|
|
if (!this._enableMSAAOnFirstPostProcess(this.samples) && this.samples > 1) {
|
|
|
- _Misc_logger__WEBPACK_IMPORTED_MODULE_2__["Logger"].Warn("MSAA failed to enable, MSAA is only supported in browsers that support webGL >= 2.0");
|
|
|
+ _Misc_logger__WEBPACK_IMPORTED_MODULE_3__["Logger"].Warn("MSAA failed to enable, MSAA is only supported in browsers that support webGL >= 2.0");
|
|
|
}
|
|
|
+ this.onBuildObservable.notifyObservers(this);
|
|
|
};
|
|
|
DefaultRenderingPipeline.prototype._disposePostProcesses = function (disposeNonRecreated) {
|
|
|
if (disposeNonRecreated === void 0) { disposeNonRecreated = false; }
|
|
@@ -170465,6 +170509,7 @@ var DefaultRenderingPipeline = /** @class */ (function (_super) {
|
|
|
* Dispose of the pipeline and stop all post processes
|
|
|
*/
|
|
|
DefaultRenderingPipeline.prototype.dispose = function () {
|
|
|
+ this.onBuildObservable.clear();
|
|
|
this._disposePostProcesses(true);
|
|
|
this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._cameras);
|
|
|
this._scene.autoClear = true;
|
|
@@ -170546,9 +170591,9 @@ var DefaultRenderingPipeline = /** @class */ (function (_super) {
|
|
|
Object(_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["serialize"])()
|
|
|
], DefaultRenderingPipeline.prototype, "grainEnabled", null);
|
|
|
return DefaultRenderingPipeline;
|
|
|
-}(_PostProcesses_RenderPipeline_postProcessRenderPipeline__WEBPACK_IMPORTED_MODULE_11__["PostProcessRenderPipeline"]));
|
|
|
+}(_PostProcesses_RenderPipeline_postProcessRenderPipeline__WEBPACK_IMPORTED_MODULE_12__["PostProcessRenderPipeline"]));
|
|
|
|
|
|
-_Misc_typeStore__WEBPACK_IMPORTED_MODULE_15__["_TypeStore"].RegisteredTypes["BABYLON.DefaultRenderingPipeline"] = DefaultRenderingPipeline;
|
|
|
+_Misc_typeStore__WEBPACK_IMPORTED_MODULE_16__["_TypeStore"].RegisteredTypes["BABYLON.DefaultRenderingPipeline"] = DefaultRenderingPipeline;
|
|
|
|
|
|
|
|
|
/***/ }),
|