|
@@ -77037,7 +77037,7 @@ var BABYLON;
|
|
|
var scene = this._scene;
|
|
|
var engine = scene.getEngine();
|
|
|
var material = subMesh.getMaterial();
|
|
|
- if (!material) {
|
|
|
+ if (!material || subMesh.verticesCount === 0) {
|
|
|
return;
|
|
|
}
|
|
|
// Culling
|
|
@@ -108612,7 +108612,7 @@ var BABYLON;
|
|
|
* After initialization enterXR can be called to start an XR session
|
|
|
* @returns Promise which resolves after it is initialized
|
|
|
*/
|
|
|
- WebXRSessionManager.prototype.initialize = function () {
|
|
|
+ WebXRSessionManager.prototype.initializeAsync = function () {
|
|
|
var _this = this;
|
|
|
// Check if the browser supports webXR
|
|
|
this._xrNavigator = navigator;
|
|
@@ -108631,7 +108631,7 @@ var BABYLON;
|
|
|
* @param frameOfReferenceType option to configure how the xr pose is expressed
|
|
|
* @returns Promise which resolves after it enters XR
|
|
|
*/
|
|
|
- WebXRSessionManager.prototype.enterXR = function (sessionCreationOptions, frameOfReferenceType) {
|
|
|
+ WebXRSessionManager.prototype.enterXRAsync = function (sessionCreationOptions, frameOfReferenceType) {
|
|
|
var _this = this;
|
|
|
// initialize session
|
|
|
return this._xrDevice.requestSession(sessionCreationOptions).then(function (session) {
|
|
@@ -108672,7 +108672,7 @@ var BABYLON;
|
|
|
* Stops the xrSession and restores the renderloop
|
|
|
* @returns Promise which resolves after it exits XR
|
|
|
*/
|
|
|
- WebXRSessionManager.prototype.exitXR = function () {
|
|
|
+ WebXRSessionManager.prototype.exitXRAsync = function () {
|
|
|
return this._xrSession.end();
|
|
|
};
|
|
|
/**
|
|
@@ -108680,7 +108680,7 @@ var BABYLON;
|
|
|
* @param ray ray to cast into the environment
|
|
|
* @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;
|
|
|
return new Promise(function (res, rej) {
|
|
|
// Compute left handed inputs to request hit test
|
|
@@ -108714,7 +108714,7 @@ var BABYLON;
|
|
|
* @param options creation options to check if they are supported
|
|
|
* @returns true if supported
|
|
|
*/
|
|
|
- WebXRSessionManager.prototype.supportsSession = function (options) {
|
|
|
+ WebXRSessionManager.prototype.supportsSessionAsync = function (options) {
|
|
|
return this._xrDevice.supportsSession(options).then(function () {
|
|
|
return true;
|
|
|
}).catch(function (e) {
|
|
@@ -108813,7 +108813,7 @@ var BABYLON;
|
|
|
*/
|
|
|
WebXRExperienceHelper.CreateAsync = function (scene) {
|
|
|
var helper = new WebXRExperienceHelper(scene);
|
|
|
- return helper._sessionManager.initialize().then(function () {
|
|
|
+ return helper._sessionManager.initializeAsync().then(function () {
|
|
|
helper._supported = true;
|
|
|
return helper;
|
|
|
}).catch(function () {
|
|
@@ -108824,9 +108824,9 @@ var BABYLON;
|
|
|
* Exits XR mode and returns the scene to its original state
|
|
|
* @returns promise that resolves after xr mode has exited
|
|
|
*/
|
|
|
- WebXRExperienceHelper.prototype.exitXR = function () {
|
|
|
+ WebXRExperienceHelper.prototype.exitXRAsync = function () {
|
|
|
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)
|
|
@@ -108834,10 +108834,10 @@ var BABYLON;
|
|
|
* @param frameOfReference frame of reference of the XR session
|
|
|
* @returns promise that resolves after xr mode has entered
|
|
|
*/
|
|
|
- WebXRExperienceHelper.prototype.enterXR = function (sessionCreationOptions, frameOfReference) {
|
|
|
+ WebXRExperienceHelper.prototype.enterXRAsync = function (sessionCreationOptions, frameOfReference) {
|
|
|
var _this = this;
|
|
|
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
|
|
|
_this._originalSceneAutoClear = _this.scene.autoClear;
|
|
|
_this._nonVRCamera = _this.scene.activeCamera;
|
|
@@ -108866,19 +108866,19 @@ var BABYLON;
|
|
|
* @param ray ray to cast into the environment
|
|
|
* @returns Promise which resolves with a collision point in the environment if it exists
|
|
|
*/
|
|
|
- WebXRExperienceHelper.prototype.environmentPointHitTest = function (ray) {
|
|
|
- return this._sessionManager.environmentPointHitTest(ray);
|
|
|
+ WebXRExperienceHelper.prototype.environmentPointHitTestAsync = function (ray) {
|
|
|
+ return this._sessionManager.environmentPointHitTestAsync(ray);
|
|
|
};
|
|
|
/**
|
|
|
* Checks if the creation options are supported by the xr session
|
|
|
* @param options creation options
|
|
|
* @returns true if supported
|
|
|
*/
|
|
|
- WebXRExperienceHelper.prototype.supportsSession = function (options) {
|
|
|
+ WebXRExperienceHelper.prototype.supportsSessionAsync = function (options) {
|
|
|
if (!this._supported) {
|
|
|
return Promise.resolve(false);
|
|
|
}
|
|
|
- return this._sessionManager.supportsSession(options);
|
|
|
+ return this._sessionManager.supportsSessionAsync(options);
|
|
|
};
|
|
|
/**
|
|
|
* Disposes of the experience helper
|
|
@@ -109020,7 +109020,7 @@ var BABYLON;
|
|
|
var _this = this;
|
|
|
var ui = new WebXREnterExitUI(scene, options);
|
|
|
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) {
|
|
@@ -109037,14 +109037,14 @@ var BABYLON;
|
|
|
case 0:
|
|
|
if (!(helper.state == BABYLON.WebXRState.IN_XR)) return [3 /*break*/, 2];
|
|
|
ui._updateButtons(null);
|
|
|
- return [4 /*yield*/, helper.exitXR()];
|
|
|
+ return [4 /*yield*/, helper.exitXRAsync()];
|
|
|
case 1:
|
|
|
_a.sent();
|
|
|
return [2 /*return*/];
|
|
|
case 2:
|
|
|
if (!(helper.state == BABYLON.WebXRState.NOT_IN_XR)) return [3 /*break*/, 4];
|
|
|
ui._updateButtons(ui._buttons[i]);
|
|
|
- return [4 /*yield*/, helper.enterXR(ui._buttons[i].initializationOptions, "eye-level")];
|
|
|
+ return [4 /*yield*/, helper.enterXRAsync(ui._buttons[i].initializationOptions, "eye-level")];
|
|
|
case 3:
|
|
|
_a.sent();
|
|
|
_a.label = 4;
|