File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
packages/uikit/src/components Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,13 @@ export class Fullscreen<
6262 batch ( ( ) => {
6363 if ( camera instanceof PerspectiveCamera ) {
6464 const cameraHeight = 2 * Math . tan ( ( Math . PI * camera . fov ) / 360 ) * distanceToCamera !
65- this . pixelSize . value = cameraHeight / this . renderer . getSize ( vectorHelper ) . y
65+ let pixelSize = cameraHeight / this . renderer . getSize ( vectorHelper ) . y
66+ //if we are in a screen-based xr session, apply the pixel ratio to the pixel size to display the UI in the same size as outside of XR
67+ const xrSession = this . renderer . xr . getSession ( )
68+ if ( xrSession ?. interactionMode === 'screen-space' ) {
69+ pixelSize *= this . renderer . getPixelRatio ( )
70+ }
71+ this . pixelSize . value = pixelSize
6672 this . sizeY . value = cameraHeight
6773 this . sizeX . value = cameraHeight * camera . aspect
6874 }
You can’t perform that action at this time.
0 commit comments