|
@@ -25815,6 +25815,7 @@ var BABYLON;
|
|
|
_this._transformMatrix = BABYLON.Matrix.Zero();
|
|
|
_this._useAlternateCameraConfiguration = false;
|
|
|
_this._alternateRendering = false;
|
|
|
+ _this._wheelEventName = "";
|
|
|
/**
|
|
|
* Gets or sets a boolean indicating if lights must be sorted by priority (off by default)
|
|
|
* This is useful if there are more lights that the maximum simulteanous authorized
|
|
@@ -26743,7 +26744,7 @@ var BABYLON;
|
|
|
pickResult = step.action(this._unTranslatedPointerX, this._unTranslatedPointerY, pickResult, isMeshPicked, canvas);
|
|
|
}
|
|
|
if (pickResult) {
|
|
|
- var type = evt.type === "mousewheel" || evt.type === "DOMMouseScroll" ? BABYLON.PointerEventTypes.POINTERWHEEL : BABYLON.PointerEventTypes.POINTERMOVE;
|
|
|
+ var type = evt.type === this._wheelEventName ? BABYLON.PointerEventTypes.POINTERWHEEL : BABYLON.PointerEventTypes.POINTERMOVE;
|
|
|
if (this.onPointerMove) {
|
|
|
this.onPointerMove(evt, pickResult, type);
|
|
|
}
|
|
@@ -27060,7 +27061,7 @@ var BABYLON;
|
|
|
this._onPointerMove = function (evt) {
|
|
|
_this._updatePointerPosition(evt);
|
|
|
// PreObservable support
|
|
|
- if (_this._checkPrePointerObservable(null, evt, evt.type === "mousewheel" || evt.type === "DOMMouseScroll" ? BABYLON.PointerEventTypes.POINTERWHEEL : BABYLON.PointerEventTypes.POINTERMOVE)) {
|
|
|
+ if (_this._checkPrePointerObservable(null, evt, evt.type === _this._wheelEventName ? BABYLON.PointerEventTypes.POINTERWHEEL : BABYLON.PointerEventTypes.POINTERMOVE)) {
|
|
|
return;
|
|
|
}
|
|
|
if (!_this.cameraToUseForPointers && !_this.activeCamera) {
|
|
@@ -27215,8 +27216,10 @@ var BABYLON;
|
|
|
if (attachMove) {
|
|
|
canvas.addEventListener(eventPrefix + "move", this._onPointerMove, false);
|
|
|
// Wheel
|
|
|
- canvas.addEventListener('mousewheel', this._onPointerMove, false);
|
|
|
- canvas.addEventListener('DOMMouseScroll', this._onPointerMove, false);
|
|
|
+ this._wheelEventName = "onwheel" in document.createElement("div") ? "wheel" : // Modern browsers support "wheel"
|
|
|
+ document.onmousewheel !== undefined ? "mousewheel" : // Webkit and IE support at least "mousewheel"
|
|
|
+ "DOMMouseScroll"; // let's assume that remaining browsers are older Firefox
|
|
|
+ canvas.addEventListener(this._wheelEventName, this._onPointerMove, false);
|
|
|
}
|
|
|
if (attachDown) {
|
|
|
canvas.addEventListener(eventPrefix + "down", this._onPointerDown, false);
|
|
@@ -27244,8 +27247,7 @@ var BABYLON;
|
|
|
engine.onCanvasFocusObservable.remove(this._onCanvasFocusObserver);
|
|
|
}
|
|
|
// Wheel
|
|
|
- canvas.removeEventListener('mousewheel', this._onPointerMove);
|
|
|
- canvas.removeEventListener('DOMMouseScroll', this._onPointerMove);
|
|
|
+ canvas.removeEventListener(this._wheelEventName, this._onPointerMove);
|
|
|
// Keyboard
|
|
|
canvas.removeEventListener("keydown", this._onKeyDown);
|
|
|
canvas.removeEventListener("keyup", this._onKeyUp);
|
|
@@ -50759,8 +50761,8 @@ var BABYLON;
|
|
|
delta = event.wheelDelta / (_this.wheelPrecision * 40);
|
|
|
}
|
|
|
}
|
|
|
- else if (event.detail) {
|
|
|
- delta = -event.detail / _this.wheelPrecision;
|
|
|
+ else if (event.detail || event.deltaY) {
|
|
|
+ delta = -(event.detail || event.deltaY) / _this.wheelPrecision;
|
|
|
}
|
|
|
if (delta) {
|
|
|
_this.camera.inertialRadiusOffset += delta;
|
|
@@ -105591,7 +105593,7 @@ var BABYLON;
|
|
|
this._beta = 0;
|
|
|
this._gamma = 0;
|
|
|
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 = -BABYLON.Tools.ToRadians(_this._screenOrientationAngle / 2);
|
|
|
_this._screenQuaternion.copyFromFloats(0, Math.sin(_this._screenOrientationAngle), 0, Math.cos(_this._screenOrientationAngle));
|
|
|
};
|