ソースを参照

address review comments around isNative

Chris Barth 4 年 前
コミット
a3bba96d11

+ 2 - 2
src/XR/features/WebXRMeshDetector.ts

@@ -123,7 +123,7 @@ export class WebXRMeshDetector extends WebXRAbstractFeature {
         }
 
         // Only supported by BabylonNative
-        if (!!this._xrSessionManager.isNativeSession() &&
+        if (!!this._xrSessionManager.isNative &&
             !!this._xrSessionManager.session.trySetMeshDetectorEnabled) {
             this._xrSessionManager.session.trySetMeshDetectorEnabled(false);
         }
@@ -198,7 +198,7 @@ export class WebXRMeshDetector extends WebXRAbstractFeature {
 
     private _init() {
         // Only supported by BabylonNative
-        if (!!this._xrSessionManager.isNativeSession()) {
+        if (!!this._xrSessionManager.isNative) {
             if (!!this._xrSessionManager.session.trySetMeshDetectorEnabled) {
                 this._xrSessionManager.session.trySetMeshDetectorEnabled(true);
             }

+ 1 - 1
src/XR/features/WebXRPlaneDetector.ts

@@ -199,7 +199,7 @@ export class WebXRPlaneDetector extends WebXRAbstractFeature {
         };
 
         // Only supported by BabylonNative
-        if (!!this._xrSessionManager.isNativeSession() &&
+        if (!!this._xrSessionManager.isNative &&
             !!this._options.preferredDetectorOptions &&
             !!this._xrSessionManager.session.trySetPreferredPlaneDetectorOptions) {
             this._xrSessionManager.session.trySetPreferredPlaneDetectorOptions(this._options.preferredDetectorOptions);

+ 2 - 2
src/XR/webXRSessionManager.ts

@@ -333,9 +333,9 @@ export class WebXRSessionManager implements IDisposable {
     }
 
     /**
-     * Returns true if the session's backend is BabylonNative, otherwise false
+     * Returns true if Babylon.js is using the BabylonNative backend, otherwise false
      */
-    public isNativeSession(): boolean {
+    public get isNative(): boolean {
         return this._xrNavigator.xr.native ?? false;
     }