|
@@ -47613,9 +47613,6 @@ var BABYLON;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
Gamepads.prototype.dispose = function () {
|
|
Gamepads.prototype.dispose = function () {
|
|
- if (Gamepads.gamepadDOMInfo) {
|
|
|
|
- document.body.removeChild(Gamepads.gamepadDOMInfo);
|
|
|
|
- }
|
|
|
|
if (this._onGamepadConnectedEvent) {
|
|
if (this._onGamepadConnectedEvent) {
|
|
window.removeEventListener('gamepadconnected', this._onGamepadConnectedEvent, false);
|
|
window.removeEventListener('gamepadconnected', this._onGamepadConnectedEvent, false);
|
|
window.removeEventListener('gamepaddisconnected', this._onGamepadDisonnectedEvent, false);
|
|
window.removeEventListener('gamepaddisconnected', this._onGamepadDisonnectedEvent, false);
|
|
@@ -47632,10 +47629,6 @@ var BABYLON;
|
|
Gamepads.prototype._addNewGamepad = function (gamepad) {
|
|
Gamepads.prototype._addNewGamepad = function (gamepad) {
|
|
if (!this.oneGamepadConnected) {
|
|
if (!this.oneGamepadConnected) {
|
|
this.oneGamepadConnected = true;
|
|
this.oneGamepadConnected = true;
|
|
- if (Gamepads.gamepadDOMInfo) {
|
|
|
|
- document.body.removeChild(Gamepads.gamepadDOMInfo);
|
|
|
|
- Gamepads.gamepadDOMInfo = null;
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
var newGamepad;
|
|
var newGamepad;
|
|
var xboxOne = (gamepad.id.search("Xbox One") !== -1);
|
|
var xboxOne = (gamepad.id.search("Xbox One") !== -1);
|
|
@@ -62251,6 +62244,7 @@ var BABYLON;
|
|
_this.devicePosition = BABYLON.Vector3.Zero();
|
|
_this.devicePosition = BABYLON.Vector3.Zero();
|
|
_this.deviceScaleFactor = 1;
|
|
_this.deviceScaleFactor = 1;
|
|
_this.controllers = [];
|
|
_this.controllers = [];
|
|
|
|
+ _this.nonVRControllers = [];
|
|
_this.rigParenting = true; // should the rig cameras be used as parent instead of this camera.
|
|
_this.rigParenting = true; // should the rig cameras be used as parent instead of this camera.
|
|
//legacy support - the compensation boolean was removed.
|
|
//legacy support - the compensation boolean was removed.
|
|
if (arguments.length === 5) {
|
|
if (arguments.length === 5) {
|
|
@@ -62339,6 +62333,16 @@ var BABYLON;
|
|
enumerable: true,
|
|
enumerable: true,
|
|
configurable: true
|
|
configurable: true
|
|
});
|
|
});
|
|
|
|
+ Object.defineProperty(WebVRFreeCamera.prototype, "onNonVRControllerAttached", {
|
|
|
|
+ set: function (callback) {
|
|
|
|
+ this._onNonVRControllerAttached = callback;
|
|
|
|
+ this.nonVRControllers.forEach(function (controller) {
|
|
|
|
+ callback(controller);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ enumerable: true,
|
|
|
|
+ configurable: true
|
|
|
|
+ });
|
|
WebVRFreeCamera.prototype.getControllerByName = function (name) {
|
|
WebVRFreeCamera.prototype.getControllerByName = function (name) {
|
|
for (var _i = 0, _a = this.controllers; _i < _a.length; _i++) {
|
|
for (var _i = 0, _a = this.controllers; _i < _a.length; _i++) {
|
|
var gp = _a[_i];
|
|
var gp = _a[_i];
|
|
@@ -62555,6 +62559,12 @@ var BABYLON;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ else {
|
|
|
|
+ _this.nonVRControllers.push(gp);
|
|
|
|
+ if (_this._onNonVRControllerAttached) {
|
|
|
|
+ _this._onNonVRControllerAttached(gp);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
});
|
|
});
|
|
};
|
|
};
|
|
return WebVRFreeCamera;
|
|
return WebVRFreeCamera;
|