@@ -299,10 +299,11 @@ export class ARRenderer extends EventDispatcher<
299
299
new PlacementBox ( scene , this . placeOnWall ? 'back' : 'bottom' ) ;
300
300
this . placementComplete = false ;
301
301
302
- this . menuPanel = new XRMenuPanel ( ) ;
303
- scene . add ( this . menuPanel ) ;
304
- this . updateMenuPanelPosition ( scene . camera , this . placementBox ! ) ; // Position the menu panel
305
-
302
+ if ( this . xrMode !== 'screen-space' ) {
303
+ this . menuPanel = new XRMenuPanel ( ) ;
304
+ scene . add ( this . menuPanel ) ;
305
+ this . updateMenuPanelPosition ( scene . camera , this . placementBox ! ) ; // Position the menu panel
306
+ }
306
307
307
308
this . lastTick = performance . now ( ) ;
308
309
this . dispatchEvent ( { type : 'status' , status : ARStatus . SESSION_STARTED } ) ;
@@ -543,13 +544,15 @@ export class ARRenderer extends EventDispatcher<
543
544
this . placementBox = new PlacementBox (
544
545
this . presentedScene ! , this . placeOnWall ? 'back' : 'bottom' ) ;
545
546
}
546
- if ( this . menuPanel ) {
547
- this . menuPanel . dispose ( ) ; // Add a dispose method to XRMenuPanel if needed
548
- this . menuPanel = null ;
549
- }
550
- this . menuPanel = new XRMenuPanel ( ) ;
551
- this . presentedScene ! . add ( this . menuPanel ) ;
552
- this . updateMenuPanelPosition ( this . presentedScene ! . camera , this . placementBox ! ) ;
547
+ if ( this . xrMode !== 'screen-space' ) {
548
+ if ( this . menuPanel ) {
549
+ this . menuPanel . dispose ( ) ;
550
+ this . menuPanel = null ;
551
+ }
552
+ this . menuPanel = new XRMenuPanel ( ) ;
553
+ this . presentedScene ! . add ( this . menuPanel ) ;
554
+ this . updateMenuPanelPosition ( this . presentedScene ! . camera , this . placementBox ! ) ;
555
+ }
553
556
554
557
} ;
555
558
0 commit comments