|
@@ -77037,7 +77037,7 @@ var BABYLON;
|
|
var scene = this._scene;
|
|
var scene = this._scene;
|
|
var engine = scene.getEngine();
|
|
var engine = scene.getEngine();
|
|
var material = subMesh.getMaterial();
|
|
var material = subMesh.getMaterial();
|
|
- if (!material) {
|
|
|
|
|
|
+ if (!material || subMesh.verticesCount === 0) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
// Culling
|
|
// Culling
|
|
@@ -77075,6 +77075,9 @@ var BABYLON;
|
|
var skeleton = mesh.skeleton;
|
|
var skeleton = mesh.skeleton;
|
|
if (skeleton.isUsingTextureForMatrices) {
|
|
if (skeleton.isUsingTextureForMatrices) {
|
|
var boneTexture = skeleton.getTransformMatrixTexture();
|
|
var boneTexture = skeleton.getTransformMatrixTexture();
|
|
|
|
+ if (!boneTexture) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
this._effect.setTexture("boneSampler", boneTexture);
|
|
this._effect.setTexture("boneSampler", boneTexture);
|
|
this._effect.setFloat("boneTextureWidth", 4.0 * (skeleton.bones.length + 1));
|
|
this._effect.setFloat("boneTextureWidth", 4.0 * (skeleton.bones.length + 1));
|
|
}
|
|
}
|
|
@@ -108609,7 +108612,7 @@ var BABYLON;
|
|
* After initialization enterXR can be called to start an XR session
|
|
* After initialization enterXR can be called to start an XR session
|
|
* @returns Promise which resolves after it is initialized
|
|
* @returns Promise which resolves after it is initialized
|
|
*/
|
|
*/
|
|
- WebXRSessionManager.prototype.initialize = function () {
|
|
|
|
|
|
+ WebXRSessionManager.prototype.initializeAsync = function () {
|
|
var _this = this;
|
|
var _this = this;
|
|
// Check if the browser supports webXR
|
|
// Check if the browser supports webXR
|
|
this._xrNavigator = navigator;
|
|
this._xrNavigator = navigator;
|
|
@@ -108628,7 +108631,7 @@ var BABYLON;
|
|
* @param frameOfReferenceType option to configure how the xr pose is expressed
|
|
* @param frameOfReferenceType option to configure how the xr pose is expressed
|
|
* @returns Promise which resolves after it enters XR
|
|
* @returns Promise which resolves after it enters XR
|
|
*/
|
|
*/
|
|
- WebXRSessionManager.prototype.enterXR = function (sessionCreationOptions, frameOfReferenceType) {
|
|
|
|
|
|
+ WebXRSessionManager.prototype.enterXRAsync = function (sessionCreationOptions, frameOfReferenceType) {
|
|
var _this = this;
|
|
var _this = this;
|
|
// initialize session
|
|
// initialize session
|
|
return this._xrDevice.requestSession(sessionCreationOptions).then(function (session) {
|
|
return this._xrDevice.requestSession(sessionCreationOptions).then(function (session) {
|
|
@@ -108669,7 +108672,7 @@ var BABYLON;
|
|
* Stops the xrSession and restores the renderloop
|
|
* Stops the xrSession and restores the renderloop
|
|
* @returns Promise which resolves after it exits XR
|
|
* @returns Promise which resolves after it exits XR
|
|
*/
|
|
*/
|
|
- WebXRSessionManager.prototype.exitXR = function () {
|
|
|
|
|
|
+ WebXRSessionManager.prototype.exitXRAsync = function () {
|
|
return this._xrSession.end();
|
|
return this._xrSession.end();
|
|
};
|
|
};
|
|
/**
|
|
/**
|
|
@@ -108677,7 +108680,7 @@ var BABYLON;
|
|
* @param ray ray to cast into the environment
|
|
* @param ray ray to cast into the environment
|
|
* @returns Promise which resolves with a collision point in the environment if it exists
|
|
* @returns Promise which resolves with a collision point in the environment if it exists
|
|
*/
|
|
*/
|
|
- WebXRSessionManager.prototype.environmentPointHitTest = function (ray) {
|
|
|
|
|
|
+ WebXRSessionManager.prototype.environmentPointHitTestAsync = function (ray) {
|
|
var _this = this;
|
|
var _this = this;
|
|
return new Promise(function (res, rej) {
|
|
return new Promise(function (res, rej) {
|
|
// Compute left handed inputs to request hit test
|
|
// Compute left handed inputs to request hit test
|
|
@@ -108711,7 +108714,7 @@ var BABYLON;
|
|
* @param options creation options to check if they are supported
|
|
* @param options creation options to check if they are supported
|
|
* @returns true if supported
|
|
* @returns true if supported
|
|
*/
|
|
*/
|
|
- WebXRSessionManager.prototype.supportsSession = function (options) {
|
|
|
|
|
|
+ WebXRSessionManager.prototype.supportsSessionAsync = function (options) {
|
|
return this._xrDevice.supportsSession(options).then(function () {
|
|
return this._xrDevice.supportsSession(options).then(function () {
|
|
return true;
|
|
return true;
|
|
}).catch(function (e) {
|
|
}).catch(function (e) {
|
|
@@ -108810,7 +108813,7 @@ var BABYLON;
|
|
*/
|
|
*/
|
|
WebXRExperienceHelper.CreateAsync = function (scene) {
|
|
WebXRExperienceHelper.CreateAsync = function (scene) {
|
|
var helper = new WebXRExperienceHelper(scene);
|
|
var helper = new WebXRExperienceHelper(scene);
|
|
- return helper._sessionManager.initialize().then(function () {
|
|
|
|
|
|
+ return helper._sessionManager.initializeAsync().then(function () {
|
|
helper._supported = true;
|
|
helper._supported = true;
|
|
return helper;
|
|
return helper;
|
|
}).catch(function () {
|
|
}).catch(function () {
|
|
@@ -108821,9 +108824,9 @@ var BABYLON;
|
|
* Exits XR mode and returns the scene to its original state
|
|
* Exits XR mode and returns the scene to its original state
|
|
* @returns promise that resolves after xr mode has exited
|
|
* @returns promise that resolves after xr mode has exited
|
|
*/
|
|
*/
|
|
- WebXRExperienceHelper.prototype.exitXR = function () {
|
|
|
|
|
|
+ WebXRExperienceHelper.prototype.exitXRAsync = function () {
|
|
this._setState(WebXRState.EXITING_XR);
|
|
this._setState(WebXRState.EXITING_XR);
|
|
- return this._sessionManager.exitXR();
|
|
|
|
|
|
+ return this._sessionManager.exitXRAsync();
|
|
};
|
|
};
|
|
/**
|
|
/**
|
|
* Enters XR mode (This must be done within a user interaction in most browsers eg. button click)
|
|
* Enters XR mode (This must be done within a user interaction in most browsers eg. button click)
|
|
@@ -108831,10 +108834,10 @@ var BABYLON;
|
|
* @param frameOfReference frame of reference of the XR session
|
|
* @param frameOfReference frame of reference of the XR session
|
|
* @returns promise that resolves after xr mode has entered
|
|
* @returns promise that resolves after xr mode has entered
|
|
*/
|
|
*/
|
|
- WebXRExperienceHelper.prototype.enterXR = function (sessionCreationOptions, frameOfReference) {
|
|
|
|
|
|
+ WebXRExperienceHelper.prototype.enterXRAsync = function (sessionCreationOptions, frameOfReference) {
|
|
var _this = this;
|
|
var _this = this;
|
|
this._setState(WebXRState.ENTERING_XR);
|
|
this._setState(WebXRState.ENTERING_XR);
|
|
- return this._sessionManager.enterXR(sessionCreationOptions, frameOfReference).then(function () {
|
|
|
|
|
|
+ return this._sessionManager.enterXRAsync(sessionCreationOptions, frameOfReference).then(function () {
|
|
// Cache pre xr scene settings
|
|
// Cache pre xr scene settings
|
|
_this._originalSceneAutoClear = _this.scene.autoClear;
|
|
_this._originalSceneAutoClear = _this.scene.autoClear;
|
|
_this._nonVRCamera = _this.scene.activeCamera;
|
|
_this._nonVRCamera = _this.scene.activeCamera;
|
|
@@ -108859,15 +108862,23 @@ var BABYLON;
|
|
});
|
|
});
|
|
};
|
|
};
|
|
/**
|
|
/**
|
|
|
|
+ * Fires a ray and returns the closest hit in the xr sessions enviornment, useful to place objects in AR
|
|
|
|
+ * @param ray ray to cast into the environment
|
|
|
|
+ * @returns Promise which resolves with a collision point in the environment if it exists
|
|
|
|
+ */
|
|
|
|
+ WebXRExperienceHelper.prototype.environmentPointHitTestAsync = function (ray) {
|
|
|
|
+ return this._sessionManager.environmentPointHitTestAsync(ray);
|
|
|
|
+ };
|
|
|
|
+ /**
|
|
* Checks if the creation options are supported by the xr session
|
|
* Checks if the creation options are supported by the xr session
|
|
* @param options creation options
|
|
* @param options creation options
|
|
* @returns true if supported
|
|
* @returns true if supported
|
|
*/
|
|
*/
|
|
- WebXRExperienceHelper.prototype.supportsSession = function (options) {
|
|
|
|
|
|
+ WebXRExperienceHelper.prototype.supportsSessionAsync = function (options) {
|
|
if (!this._supported) {
|
|
if (!this._supported) {
|
|
return Promise.resolve(false);
|
|
return Promise.resolve(false);
|
|
}
|
|
}
|
|
- return this._sessionManager.supportsSession(options);
|
|
|
|
|
|
+ return this._sessionManager.supportsSessionAsync(options);
|
|
};
|
|
};
|
|
/**
|
|
/**
|
|
* Disposes of the experience helper
|
|
* Disposes of the experience helper
|
|
@@ -108923,6 +108934,32 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
var BABYLON;
|
|
var BABYLON;
|
|
(function (BABYLON) {
|
|
(function (BABYLON) {
|
|
/**
|
|
/**
|
|
|
|
+ * Button which can be used to enter a different mode of XR
|
|
|
|
+ */
|
|
|
|
+ var WebXREnterExitUIButton = /** @class */ (function () {
|
|
|
|
+ /**
|
|
|
|
+ * Creates a WebXREnterExitUIButton
|
|
|
|
+ * @param element button element
|
|
|
|
+ * @param initializationOptions XR initialization options for the button
|
|
|
|
+ */
|
|
|
|
+ function WebXREnterExitUIButton(
|
|
|
|
+ /** button element */
|
|
|
|
+ element,
|
|
|
|
+ /** XR initialization options for the button */
|
|
|
|
+ initializationOptions) {
|
|
|
|
+ this.element = element;
|
|
|
|
+ this.initializationOptions = initializationOptions;
|
|
|
|
+ }
|
|
|
|
+ /**
|
|
|
|
+ * Overwritable function which can be used to update the button's visuals when the state changes
|
|
|
|
+ * @param activeButton the current active button in the UI
|
|
|
|
+ */
|
|
|
|
+ WebXREnterExitUIButton.prototype.update = function (activeButton) {
|
|
|
|
+ };
|
|
|
|
+ return WebXREnterExitUIButton;
|
|
|
|
+ }());
|
|
|
|
+ BABYLON.WebXREnterExitUIButton = WebXREnterExitUIButton;
|
|
|
|
+ /**
|
|
* Options to create the webXR UI
|
|
* Options to create the webXR UI
|
|
*/
|
|
*/
|
|
var WebXREnterExitUIOptions = /** @class */ (function () {
|
|
var WebXREnterExitUIOptions = /** @class */ (function () {
|
|
@@ -108939,6 +108976,7 @@ var BABYLON;
|
|
var _this = this;
|
|
var _this = this;
|
|
this.scene = scene;
|
|
this.scene = scene;
|
|
this._buttons = [];
|
|
this._buttons = [];
|
|
|
|
+ this._activeButton = null;
|
|
this._overlay = document.createElement("div");
|
|
this._overlay = document.createElement("div");
|
|
this._overlay.style.cssText = "z-index:11;position: absolute; right: 20px;bottom: 50px;";
|
|
this._overlay.style.cssText = "z-index:11;position: absolute; right: 20px;bottom: 50px;";
|
|
if (options.customButtons) {
|
|
if (options.customButtons) {
|
|
@@ -108948,11 +108986,20 @@ var BABYLON;
|
|
var hmdBtn = document.createElement("button");
|
|
var hmdBtn = document.createElement("button");
|
|
hmdBtn.style.cssText = "color: #868686; border-color: #868686; border-style: solid; margin-left: 10px; height: 50px; width: 80px; background-color: rgba(51,51,51,0.7); background-repeat:no-repeat; background-position: center; outline: none;";
|
|
hmdBtn.style.cssText = "color: #868686; border-color: #868686; border-style: solid; margin-left: 10px; height: 50px; width: 80px; background-color: rgba(51,51,51,0.7); background-repeat:no-repeat; background-position: center; outline: none;";
|
|
hmdBtn.innerText = "HMD";
|
|
hmdBtn.innerText = "HMD";
|
|
- this._buttons.push({ element: hmdBtn, initializationOptions: { immersive: true } });
|
|
|
|
|
|
+ this._buttons.push(new WebXREnterExitUIButton(hmdBtn, { immersive: true, outputContext: options.outputCanvasContext }));
|
|
|
|
+ this._buttons[this._buttons.length - 1].update = function (activeButton) {
|
|
|
|
+ this.element.style.display = (activeButton === null || activeButton === this) ? "" : "none";
|
|
|
|
+ this.element.innerText = activeButton === this ? "EXIT" : "HMD";
|
|
|
|
+ };
|
|
var windowBtn = document.createElement("button");
|
|
var windowBtn = document.createElement("button");
|
|
windowBtn.style.cssText = hmdBtn.style.cssText;
|
|
windowBtn.style.cssText = hmdBtn.style.cssText;
|
|
windowBtn.innerText = "Window";
|
|
windowBtn.innerText = "Window";
|
|
- this._buttons.push({ element: windowBtn, initializationOptions: { immersive: false, environmentIntegration: true, outputContext: options.outputCanvasContext } });
|
|
|
|
|
|
+ this._buttons.push(new WebXREnterExitUIButton(windowBtn, { immersive: false, environmentIntegration: true, outputContext: options.outputCanvasContext }));
|
|
|
|
+ this._buttons[this._buttons.length - 1].update = function (activeButton) {
|
|
|
|
+ this.element.style.display = (activeButton === null || activeButton === this) ? "" : "none";
|
|
|
|
+ this.element.innerText = activeButton === this ? "EXIT" : "Window";
|
|
|
|
+ };
|
|
|
|
+ this._updateButtons(null);
|
|
}
|
|
}
|
|
var renderCanvas = scene.getEngine().getRenderingCanvas();
|
|
var renderCanvas = scene.getEngine().getRenderingCanvas();
|
|
if (renderCanvas && renderCanvas.parentNode) {
|
|
if (renderCanvas && renderCanvas.parentNode) {
|
|
@@ -108973,7 +109020,12 @@ var BABYLON;
|
|
var _this = this;
|
|
var _this = this;
|
|
var ui = new WebXREnterExitUI(scene, options);
|
|
var ui = new WebXREnterExitUI(scene, options);
|
|
var supportedPromises = ui._buttons.map(function (btn) {
|
|
var supportedPromises = ui._buttons.map(function (btn) {
|
|
- return helper.supportsSession(btn.initializationOptions);
|
|
|
|
|
|
+ return helper.supportsSessionAsync(btn.initializationOptions);
|
|
|
|
+ });
|
|
|
|
+ helper.onStateChangedObservable.add(function (state) {
|
|
|
|
+ if (state == BABYLON.WebXRState.NOT_IN_XR) {
|
|
|
|
+ ui._updateButtons(null);
|
|
|
|
+ }
|
|
});
|
|
});
|
|
return Promise.all(supportedPromises).then(function (results) {
|
|
return Promise.all(supportedPromises).then(function (results) {
|
|
results.forEach(function (supported, i) {
|
|
results.forEach(function (supported, i) {
|
|
@@ -108984,13 +109036,15 @@ var BABYLON;
|
|
switch (_a.label) {
|
|
switch (_a.label) {
|
|
case 0:
|
|
case 0:
|
|
if (!(helper.state == BABYLON.WebXRState.IN_XR)) return [3 /*break*/, 2];
|
|
if (!(helper.state == BABYLON.WebXRState.IN_XR)) return [3 /*break*/, 2];
|
|
- return [4 /*yield*/, helper.exitXR()];
|
|
|
|
|
|
+ ui._updateButtons(null);
|
|
|
|
+ return [4 /*yield*/, helper.exitXRAsync()];
|
|
case 1:
|
|
case 1:
|
|
_a.sent();
|
|
_a.sent();
|
|
return [2 /*return*/];
|
|
return [2 /*return*/];
|
|
case 2:
|
|
case 2:
|
|
if (!(helper.state == BABYLON.WebXRState.NOT_IN_XR)) return [3 /*break*/, 4];
|
|
if (!(helper.state == BABYLON.WebXRState.NOT_IN_XR)) return [3 /*break*/, 4];
|
|
- return [4 /*yield*/, helper.enterXR(ui._buttons[i].initializationOptions, "eye-level")];
|
|
|
|
|
|
+ ui._updateButtons(ui._buttons[i]);
|
|
|
|
+ return [4 /*yield*/, helper.enterXRAsync(ui._buttons[i].initializationOptions, "eye-level")];
|
|
case 3:
|
|
case 3:
|
|
_a.sent();
|
|
_a.sent();
|
|
_a.label = 4;
|
|
_a.label = 4;
|
|
@@ -109002,6 +109056,13 @@ var BABYLON;
|
|
});
|
|
});
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
+ WebXREnterExitUI.prototype._updateButtons = function (activeButton) {
|
|
|
|
+ var _this = this;
|
|
|
|
+ this._activeButton = activeButton;
|
|
|
|
+ this._buttons.forEach(function (b) {
|
|
|
|
+ b.update(_this._activeButton);
|
|
|
|
+ });
|
|
|
|
+ };
|
|
/**
|
|
/**
|
|
* Disposes of the object
|
|
* Disposes of the object
|
|
*/
|
|
*/
|
|
@@ -109038,7 +109099,7 @@ var BABYLON;
|
|
this.canvasContext = null;
|
|
this.canvasContext = null;
|
|
if (!canvas) {
|
|
if (!canvas) {
|
|
canvas = document.createElement('canvas');
|
|
canvas = document.createElement('canvas');
|
|
- canvas.style.cssText = "position:absolute; bottom:0px;right:0px;z-index:10;width:100%;height:100%;background-color: #48989e;";
|
|
|
|
|
|
+ canvas.style.cssText = "position:absolute; bottom:0px;right:0px;z-index:10;width:100%;height:100%;background-color: #000000;";
|
|
}
|
|
}
|
|
this._setManagedOutputCanvas(canvas);
|
|
this._setManagedOutputCanvas(canvas);
|
|
helper.onStateChangedObservable.add(function (stateInfo) {
|
|
helper.onStateChangedObservable.add(function (stateInfo) {
|
|
@@ -109086,6 +109147,104 @@ var BABYLON;
|
|
|
|
|
|
//# sourceMappingURL=babylon.webXRManagedOutputCanvas.js.map
|
|
//# sourceMappingURL=babylon.webXRManagedOutputCanvas.js.map
|
|
|
|
|
|
|
|
+var BABYLON;
|
|
|
|
+(function (BABYLON) {
|
|
|
|
+ /**
|
|
|
|
+ * Represents an XR input
|
|
|
|
+ */
|
|
|
|
+ var WebXRController = /** @class */ (function () {
|
|
|
|
+ /**
|
|
|
|
+ * Creates the controller
|
|
|
|
+ * @see https://doc.babylonjs.com/how_to/webxr
|
|
|
|
+ * @param scene the scene which the controller should be associated to
|
|
|
|
+ */
|
|
|
|
+ function WebXRController(scene) {
|
|
|
|
+ this.pointer = new BABYLON.AbstractMesh("controllerPointer", scene);
|
|
|
|
+ }
|
|
|
|
+ /**
|
|
|
|
+ * Disposes of the object
|
|
|
|
+ */
|
|
|
|
+ WebXRController.prototype.dispose = function () {
|
|
|
|
+ if (this.grip) {
|
|
|
|
+ this.grip.dispose();
|
|
|
|
+ }
|
|
|
|
+ this.pointer.dispose();
|
|
|
|
+ };
|
|
|
|
+ return WebXRController;
|
|
|
|
+ }());
|
|
|
|
+ BABYLON.WebXRController = WebXRController;
|
|
|
|
+ /**
|
|
|
|
+ * XR input used to track XR inputs such as controllers/rays
|
|
|
|
+ */
|
|
|
|
+ var WebXRInput = /** @class */ (function () {
|
|
|
|
+ /**
|
|
|
|
+ * Initializes the WebXRInput
|
|
|
|
+ * @param helper experience helper which the input should be created for
|
|
|
|
+ */
|
|
|
|
+ function WebXRInput(helper) {
|
|
|
|
+ var _this = this;
|
|
|
|
+ this.helper = helper;
|
|
|
|
+ /**
|
|
|
|
+ * XR controllers being tracked
|
|
|
|
+ */
|
|
|
|
+ this.controllers = [];
|
|
|
|
+ this._tmpMatrix = new BABYLON.Matrix();
|
|
|
|
+ this._frameObserver = helper._sessionManager.onXRFrameObservable.add(function () {
|
|
|
|
+ if (!helper._sessionManager._currentXRFrame || !helper._sessionManager._currentXRFrame.getDevicePose) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ var xrFrame = helper._sessionManager._currentXRFrame;
|
|
|
|
+ var inputSources = helper._sessionManager._xrSession.getInputSources();
|
|
|
|
+ inputSources.forEach(function (input, i) {
|
|
|
|
+ var inputPose = xrFrame.getInputPose(input, helper._sessionManager._frameOfReference);
|
|
|
|
+ if (inputPose) {
|
|
|
|
+ if (_this.controllers.length <= i) {
|
|
|
|
+ _this.controllers.push(new WebXRController(helper.container.getScene()));
|
|
|
|
+ }
|
|
|
|
+ var controller = _this.controllers[i];
|
|
|
|
+ // Manage the grip if it exists
|
|
|
|
+ if (inputPose.gripMatrix) {
|
|
|
|
+ if (!controller.grip) {
|
|
|
|
+ controller.grip = new BABYLON.AbstractMesh("controllerGrip", helper.container.getScene());
|
|
|
|
+ }
|
|
|
|
+ BABYLON.Matrix.FromFloat32ArrayToRefScaled(inputPose.gripMatrix, 0, 1, _this._tmpMatrix);
|
|
|
|
+ if (!controller.grip.getScene().useRightHandedSystem) {
|
|
|
|
+ _this._tmpMatrix.toggleModelMatrixHandInPlace();
|
|
|
|
+ }
|
|
|
|
+ if (!controller.grip.rotationQuaternion) {
|
|
|
|
+ controller.grip.rotationQuaternion = new BABYLON.Quaternion();
|
|
|
|
+ }
|
|
|
|
+ _this._tmpMatrix.decompose(controller.grip.scaling, controller.grip.rotationQuaternion, controller.grip.position);
|
|
|
|
+ }
|
|
|
|
+ // Manager pointer of controller
|
|
|
|
+ BABYLON.Matrix.FromFloat32ArrayToRefScaled(inputPose.targetRay.transformMatrix, 0, 1, _this._tmpMatrix);
|
|
|
|
+ if (!controller.pointer.getScene().useRightHandedSystem) {
|
|
|
|
+ _this._tmpMatrix.toggleModelMatrixHandInPlace();
|
|
|
|
+ }
|
|
|
|
+ if (!controller.pointer.rotationQuaternion) {
|
|
|
|
+ controller.pointer.rotationQuaternion = new BABYLON.Quaternion();
|
|
|
|
+ }
|
|
|
|
+ _this._tmpMatrix.decompose(controller.pointer.scaling, controller.pointer.rotationQuaternion, controller.pointer.position);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ /**
|
|
|
|
+ * Disposes of the object
|
|
|
|
+ */
|
|
|
|
+ WebXRInput.prototype.dispose = function () {
|
|
|
|
+ this.controllers.forEach(function (c) {
|
|
|
|
+ c.dispose();
|
|
|
|
+ });
|
|
|
|
+ this.helper._sessionManager.onXRFrameObservable.remove(this._frameObserver);
|
|
|
|
+ };
|
|
|
|
+ return WebXRInput;
|
|
|
|
+ }());
|
|
|
|
+ BABYLON.WebXRInput = WebXRInput;
|
|
|
|
+})(BABYLON || (BABYLON = {}));
|
|
|
|
+
|
|
|
|
+//# sourceMappingURL=babylon.webXRInput.js.map
|
|
|
|
+
|
|
// Mainly based on these 2 articles :
|
|
// Mainly based on these 2 articles :
|
|
// Creating an universal virtual touch joystick working for all Touch models thanks to Hand.JS : http://blogs.msdn.com/b/davrous/archive/2013/02/22/creating-an-universal-virtual-touch-joystick-working-for-all-touch-models-thanks-to-hand-js.aspx
|
|
// Creating an universal virtual touch joystick working for all Touch models thanks to Hand.JS : http://blogs.msdn.com/b/davrous/archive/2013/02/22/creating-an-universal-virtual-touch-joystick-working-for-all-touch-models-thanks-to-hand-js.aspx
|
|
// & on Seb Lee-Delisle original work: http://seb.ly/2011/04/multi-touch-game-controller-in-javascripthtml5-for-ipad/
|
|
// & on Seb Lee-Delisle original work: http://seb.ly/2011/04/multi-touch-game-controller-in-javascripthtml5-for-ipad/
|
|
@@ -119986,7 +120145,9 @@ var BABYLON;
|
|
var _this = this;
|
|
var _this = this;
|
|
return BABYLON.WebXRExperienceHelper.CreateAsync(this).then(function (helper) {
|
|
return BABYLON.WebXRExperienceHelper.CreateAsync(this).then(function (helper) {
|
|
var outputCanvas = new BABYLON.WebXRManagedOutputCanvas(helper);
|
|
var outputCanvas = new BABYLON.WebXRManagedOutputCanvas(helper);
|
|
- return BABYLON.WebXREnterExitUI.CreateAsync(_this, helper, { outputCanvasContext: outputCanvas.canvasContext }).then(function (ui) {
|
|
|
|
|
|
+ return BABYLON.WebXREnterExitUI.CreateAsync(_this, helper, { outputCanvasContext: outputCanvas.canvasContext })
|
|
|
|
+ .then(function (ui) {
|
|
|
|
+ new BABYLON.WebXRInput(helper);
|
|
return helper;
|
|
return helper;
|
|
});
|
|
});
|
|
});
|
|
});
|