From 6b10bbbd20fa429315845ce1894bebf881ddf12a Mon Sep 17 00:00:00 2001 From: azeppenfeld Date: Wed, 3 Dec 2025 15:16:20 -0800 Subject: [PATCH 1/4] Add snippet for dec jxr release. --- gradle/libs.versions.toml | 6 +- .../com/example/xr/compose/SceneCoreEntity.kt | 46 ++++++++++ .../java/com/example/xr/compose/Subspace.kt | 5 +- .../java/com/example/xr/compose/Volume.kt | 91 ------------------- 4 files changed, 51 insertions(+), 97 deletions(-) create mode 100644 xr/src/main/java/com/example/xr/compose/SceneCoreEntity.kt delete mode 100644 xr/src/main/java/com/example/xr/compose/Volume.kt diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 712f4dfdd..ffc5fdded 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -29,9 +29,9 @@ androidx-test-junit = "1.3.0" androidx-window = "1.5.0" androidx-window-core = "1.5.0" androidx-window-java = "1.5.0" -androidx-xr-arcore = "1.0.0-alpha07" -androidx-xr-compose = "1.0.0-alpha08" -androidx-xr-scenecore = "1.0.0-alpha08" +androidx-xr-arcore = "1.0.0-alpha09" +androidx-xr-compose = "1.0.0-alpha09" +androidx-xr-scenecore = "1.0.0-alpha10" androidxHiltNavigationCompose = "1.3.0" appcompat = "1.7.1" arcorePlayServices = "1.0.0-alpha08" diff --git a/xr/src/main/java/com/example/xr/compose/SceneCoreEntity.kt b/xr/src/main/java/com/example/xr/compose/SceneCoreEntity.kt new file mode 100644 index 000000000..d5428c3e6 --- /dev/null +++ b/xr/src/main/java/com/example/xr/compose/SceneCoreEntity.kt @@ -0,0 +1,46 @@ +package com.example.xr.compose + +import androidx.compose.runtime.Composable +import androidx.compose.ui.unit.dp +import androidx.xr.compose.platform.LocalSession +import androidx.xr.compose.spatial.Subspace +import androidx.xr.compose.subspace.SceneCoreEntity +import androidx.xr.compose.subspace.SceneCoreEntitySizeAdapter +import androidx.xr.compose.subspace.layout.SubspaceModifier +import androidx.xr.compose.subspace.layout.offset +import androidx.xr.runtime.math.IntSize2d +import androidx.xr.runtime.math.Pose +import androidx.xr.scenecore.SurfaceEntity + +@Composable +fun SceneCoreEntityExample() { + val session = LocalSession.current + if (session !== null) { + // [START androidxr_compose_SceneCoreEntity] + Subspace { + SceneCoreEntity( + modifier = SubspaceModifier.offset(x = 50.dp), + factory = { + SurfaceEntity.create( + session = session, + pose = Pose.Identity, + stereoMode = SurfaceEntity.StereoMode.MONO + ) + }, + update = { entity -> + // compose state changes may be applied to the + // SceneCore entity here. + entity.stereoMode = SurfaceEntity.StereoMode.SIDE_BY_SIDE + }, + sizeAdapter = + SceneCoreEntitySizeAdapter({ + IntSize2d(it.width, it.height) + }), + ) { + // Content here will be children of the SceneCoreEntity + // in the scene graph. + } + } + // [END androidxr_compose_SceneCoreEntity] + } +} \ No newline at end of file diff --git a/xr/src/main/java/com/example/xr/compose/Subspace.kt b/xr/src/main/java/com/example/xr/compose/Subspace.kt index a1121211c..6fade701f 100644 --- a/xr/src/main/java/com/example/xr/compose/Subspace.kt +++ b/xr/src/main/java/com/example/xr/compose/Subspace.kt @@ -23,7 +23,6 @@ import androidx.activity.enableEdgeToEdge import androidx.compose.foundation.layout.Row import androidx.compose.runtime.Composable import androidx.xr.compose.platform.LocalSession -import androidx.xr.compose.spatial.ApplicationSubspace import androidx.xr.compose.spatial.Subspace import androidx.xr.compose.subspace.SpatialPanel import androidx.xr.scenecore.scene @@ -35,7 +34,7 @@ private class SubspaceActivity : ComponentActivity() { // [START androidxr_compose_SubspaceSetContent] setContent { // This is a top-level subspace - ApplicationSubspace { + Subspace { SpatialPanel { MyComposable() } @@ -59,7 +58,7 @@ private fun PrimaryPane() { // This is a nested subspace, because PrimaryPane is in a SpatialPanel // and that SpatialPanel is in a top-level Subspace Subspace { - ObjectInAVolume(true) + SpatialPanel {} } } // [END androidxr_compose_SubspaceComponents] diff --git a/xr/src/main/java/com/example/xr/compose/Volume.kt b/xr/src/main/java/com/example/xr/compose/Volume.kt deleted file mode 100644 index 2144cc3c2..000000000 --- a/xr/src/main/java/com/example/xr/compose/Volume.kt +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2025 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.example.xr.compose - -import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.material3.Text -import androidx.compose.runtime.Composable -import androidx.compose.runtime.rememberCoroutineScope -import androidx.compose.ui.Alignment -import androidx.compose.ui.Modifier -import androidx.compose.ui.unit.dp -import androidx.compose.ui.unit.sp -import androidx.xr.compose.platform.LocalSession -import androidx.xr.compose.spatial.Subspace -import androidx.xr.compose.subspace.ExperimentalSubspaceVolumeApi -import androidx.xr.compose.subspace.MovePolicy -import androidx.xr.compose.subspace.ResizePolicy -import androidx.xr.compose.subspace.SpatialPanel -import androidx.xr.compose.subspace.Volume -import androidx.xr.compose.subspace.layout.SubspaceModifier -import androidx.xr.compose.subspace.layout.height -import androidx.xr.compose.subspace.layout.offset -import androidx.xr.compose.subspace.layout.scale -import androidx.xr.compose.subspace.layout.width -import kotlinx.coroutines.launch - -@Composable -private fun VolumeExample() { - // [START androidxr_compose_Volume] - Subspace { - SpatialPanel( - SubspaceModifier.height(1500.dp).width(1500.dp), - dragPolicy = MovePolicy(), - resizePolicy = ResizePolicy(), - ) { - ObjectInAVolume(true) - Box( - Modifier.fillMaxSize(), - contentAlignment = Alignment.Center - ) { - Text( - text = "Welcome", - fontSize = 50.sp, - ) - } - } - } - // [END androidxr_compose_Volume] -} - -// [START androidxr_compose_ObjectInAVolume] -@OptIn(ExperimentalSubspaceVolumeApi::class) -@Composable -fun ObjectInAVolume(show3DObject: Boolean) { - // [START_EXCLUDE silent] - val volumeXOffset = 0.dp - val volumeYOffset = 0.dp - val volumeZOffset = 0.dp - // [END_EXCLUDE] - val session = checkNotNull(LocalSession.current) - val scope = rememberCoroutineScope() - if (show3DObject) { - Subspace { - Volume( - modifier = SubspaceModifier - .offset(volumeXOffset, volumeYOffset, volumeZOffset) // Relative position - .scale(1.2f) // Scale to 120% of the size - ) { parent -> - scope.launch { - // Load your 3D model here - } - } - } - } -} -// [END androidxr_compose_ObjectInAVolume] From a710fc21637589d6f9adfb42b79cac80a673ef3c Mon Sep 17 00:00:00 2001 From: amyZepp <134542280+amyZepp@users.noreply.github.com> Date: Wed, 3 Dec 2025 23:20:44 +0000 Subject: [PATCH 2/4] Apply Spotless --- .../com/example/xr/compose/SceneCoreEntity.kt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/xr/src/main/java/com/example/xr/compose/SceneCoreEntity.kt b/xr/src/main/java/com/example/xr/compose/SceneCoreEntity.kt index d5428c3e6..17006e7f2 100644 --- a/xr/src/main/java/com/example/xr/compose/SceneCoreEntity.kt +++ b/xr/src/main/java/com/example/xr/compose/SceneCoreEntity.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2025 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.example.xr.compose import androidx.compose.runtime.Composable From b5813ad5670ae909e39d4e28ba91066b8da6a0b5 Mon Sep 17 00:00:00 2001 From: azeppenfeld Date: Wed, 3 Dec 2025 15:16:20 -0800 Subject: [PATCH 3/4] Add snippet for dec jxr release. --- gradle/libs.versions.toml | 2 +- .../com/example/xr/scenecore/GltfEntity.kt | 6 ++---- .../xr/scenecore/InteractableComponent.kt | 6 +++--- .../xr/scenecore/ResizableComponent.kt | 2 +- .../com/example/xr/scenecore/SpatialAudio.kt | 11 +++++----- .../xr/scenecore/SpatialCapabilities.kt | 13 ++++++------ .../com/example/xr/scenecore/SpatialVideo.kt | 20 +++++++++---------- 7 files changed, 28 insertions(+), 32 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ffc5fdded..d188a0a25 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -34,7 +34,7 @@ androidx-xr-compose = "1.0.0-alpha09" androidx-xr-scenecore = "1.0.0-alpha10" androidxHiltNavigationCompose = "1.3.0" appcompat = "1.7.1" -arcorePlayServices = "1.0.0-alpha08" +arcorePlayServices = "1.0.0-alpha09" coil = "2.7.0" # @keep compileSdk = "36" diff --git a/xr/src/main/java/com/example/xr/scenecore/GltfEntity.kt b/xr/src/main/java/com/example/xr/scenecore/GltfEntity.kt index cf39f9f4f..7044c046e 100644 --- a/xr/src/main/java/com/example/xr/scenecore/GltfEntity.kt +++ b/xr/src/main/java/com/example/xr/scenecore/GltfEntity.kt @@ -23,7 +23,7 @@ import androidx.activity.ComponentActivity import androidx.xr.runtime.Session import androidx.xr.scenecore.GltfModel import androidx.xr.scenecore.GltfModelEntity -import androidx.xr.scenecore.SpatialCapabilities +import androidx.xr.scenecore.SpatialCapability import androidx.xr.scenecore.scene import java.nio.file.Paths @@ -35,9 +35,7 @@ private suspend fun loadGltfFile(session: Session) { private fun createModelEntity(session: Session, gltfModel: GltfModel) { // [START androidxr_scenecore_gltfmodelentity_create] - if (session.scene.spatialCapabilities - .hasCapability(SpatialCapabilities.SPATIAL_CAPABILITY_3D_CONTENT) - ) { + if (session.scene.spatialCapabilities.contains(SpatialCapability.SPATIAL_3D_CONTENT)) { val gltfEntity = GltfModelEntity.create(session, gltfModel) } // [END androidxr_scenecore_gltfmodelentity_create] diff --git a/xr/src/main/java/com/example/xr/scenecore/InteractableComponent.kt b/xr/src/main/java/com/example/xr/scenecore/InteractableComponent.kt index a712d0dfe..a40aae3eb 100644 --- a/xr/src/main/java/com/example/xr/scenecore/InteractableComponent.kt +++ b/xr/src/main/java/com/example/xr/scenecore/InteractableComponent.kt @@ -27,11 +27,11 @@ private fun interactableComponentExample(session: Session, entity: Entity) { val executor = Executors.newSingleThreadExecutor() val interactableComponent = InteractableComponent.create(session, executor) { // when the user disengages with the entity with their hands - if (it.source == InputEvent.Source.SOURCE_HANDS && it.action == InputEvent.Action.ACTION_UP) { + if (it.source == InputEvent.Source.HANDS && it.action == InputEvent.Action.UP) { // increase size with right hand and decrease with left - if (it.pointerType == InputEvent.Pointer.POINTER_TYPE_RIGHT) { + if (it.pointerType == InputEvent.Pointer.RIGHT) { entity.setScale(1.5f) - } else if (it.pointerType == InputEvent.Pointer.POINTER_TYPE_LEFT) { + } else if (it.pointerType == InputEvent.Pointer.LEFT) { entity.setScale(0.5f) } } diff --git a/xr/src/main/java/com/example/xr/scenecore/ResizableComponent.kt b/xr/src/main/java/com/example/xr/scenecore/ResizableComponent.kt index e4136ea72..708b28237 100644 --- a/xr/src/main/java/com/example/xr/scenecore/ResizableComponent.kt +++ b/xr/src/main/java/com/example/xr/scenecore/ResizableComponent.kt @@ -31,7 +31,7 @@ private fun resizableComponentExample( ) { // [START androidxr_scenecore_resizableComponentExample] val resizableComponent = ResizableComponent.create(session) { event -> - if (event.resizeState == ResizeEvent.ResizeState.RESIZE_STATE_END) { + if (event.resizeState == ResizeEvent.ResizeState.END) { // update the Entity to reflect the new size surfaceEntity.shape = SurfaceEntity.Shape.Quad(FloatSize2d(event.newSize.width, event.newSize.height)) } diff --git a/xr/src/main/java/com/example/xr/scenecore/SpatialAudio.kt b/xr/src/main/java/com/example/xr/scenecore/SpatialAudio.kt index 25b1556a4..32f5b3571 100644 --- a/xr/src/main/java/com/example/xr/scenecore/SpatialAudio.kt +++ b/xr/src/main/java/com/example/xr/scenecore/SpatialAudio.kt @@ -30,7 +30,7 @@ import androidx.xr.runtime.Session import androidx.xr.scenecore.Entity import androidx.xr.scenecore.PointSourceParams import androidx.xr.scenecore.SoundFieldAttributes -import androidx.xr.scenecore.SpatialCapabilities +import androidx.xr.scenecore.SpatialCapability import androidx.xr.scenecore.SpatialMediaPlayer import androidx.xr.scenecore.SpatialSoundPool import androidx.xr.scenecore.SpatializerConstants @@ -39,8 +39,7 @@ import androidx.xr.scenecore.scene private fun playSpatialAudioAtEntity(session: Session, appContext: Context, entity: Entity) { // [START androidxr_scenecore_playSpatialAudio] // Check spatial capabilities before using spatial audio - if (session.scene.spatialCapabilities - .hasCapability(SpatialCapabilities.SPATIAL_CAPABILITY_SPATIAL_AUDIO) + if (session.scene.spatialCapabilities.contains(SpatialCapability.SPATIAL_AUDIO) ) { // The session has spatial audio capabilities val maxVolume = 1F val lowPriority = 0 @@ -85,7 +84,7 @@ private fun playSpatialAudioAtEntity(session: Session, appContext: Context, enti private fun playSpatialAudioAtEntitySurround(session: Session, appContext: Context) { // [START androidxr_scenecore_playSpatialAudioSurround] // Check spatial capabilities before using spatial audio - if (session.scene.spatialCapabilities.hasCapability(SpatialCapabilities.SPATIAL_CAPABILITY_SPATIAL_AUDIO)) { + if (session.scene.spatialCapabilities.contains(SpatialCapability.SPATIAL_AUDIO)) { // The session has spatial audio capabilities val pointSourceAttributes = PointSourceParams(session.scene.mainPanelEntity) @@ -120,11 +119,11 @@ private fun playSpatialAudioAtEntitySurround(session: Session, appContext: Conte private fun playSpatialAudioAtEntityAmbionics(session: Session, appContext: Context) { // [START androidxr_scenecore_playSpatialAudioAmbionics] // Check spatial capabilities before using spatial audio - if (session.scene.spatialCapabilities.hasCapability(SpatialCapabilities.SPATIAL_CAPABILITY_SPATIAL_AUDIO)) { + if (session.scene.spatialCapabilities.contains(SpatialCapability.SPATIAL_AUDIO)) { // The session has spatial audio capabilities val soundFieldAttributes = - SoundFieldAttributes(SpatializerConstants.AMBISONICS_ORDER_FIRST_ORDER) + SoundFieldAttributes(SpatializerConstants.AmbisonicsOrder.FIRST_ORDER) val mediaPlayer = MediaPlayer() diff --git a/xr/src/main/java/com/example/xr/scenecore/SpatialCapabilities.kt b/xr/src/main/java/com/example/xr/scenecore/SpatialCapabilities.kt index 7fb784080..6206893f2 100644 --- a/xr/src/main/java/com/example/xr/scenecore/SpatialCapabilities.kt +++ b/xr/src/main/java/com/example/xr/scenecore/SpatialCapabilities.kt @@ -17,23 +17,22 @@ package com.example.xr.scenecore import androidx.xr.runtime.Session -import androidx.xr.scenecore.SpatialCapabilities +import androidx.xr.scenecore.SpatialCapability +import androidx.xr.scenecore.SpatialCapability.Companion.SPATIAL_3D_CONTENT import androidx.xr.scenecore.scene fun checkMultipleCapabilities(xrSession: Session) { // [START androidxr_compose_checkMultipleCapabilities] // Example 1: check if enabling passthrough mode is allowed - if (xrSession.scene.spatialCapabilities.hasCapability( - SpatialCapabilities.SPATIAL_CAPABILITY_PASSTHROUGH_CONTROL + if (xrSession.scene.spatialCapabilities.contains( + SpatialCapability.PASSTHROUGH_CONTROL ) ) { xrSession.scene.spatialEnvironment.preferredPassthroughOpacity = 1f } // Example 2: multiple capability flags can be checked simultaneously: - if (xrSession.scene.spatialCapabilities.hasCapability( - SpatialCapabilities.SPATIAL_CAPABILITY_PASSTHROUGH_CONTROL and - SpatialCapabilities.SPATIAL_CAPABILITY_3D_CONTENT - ) + if (xrSession.scene.spatialCapabilities.contains(SpatialCapability.PASSTHROUGH_CONTROL) && + xrSession.scene.spatialCapabilities.contains(SPATIAL_3D_CONTENT) ) { // ... } diff --git a/xr/src/main/java/com/example/xr/scenecore/SpatialVideo.kt b/xr/src/main/java/com/example/xr/scenecore/SpatialVideo.kt index 85f1dfa05..f1d6c4290 100644 --- a/xr/src/main/java/com/example/xr/scenecore/SpatialVideo.kt +++ b/xr/src/main/java/com/example/xr/scenecore/SpatialVideo.kt @@ -37,7 +37,7 @@ private fun ComponentActivity.surfaceEntityCreate(xrSession: Session) { // [START androidxr_scenecore_surfaceEntityCreate] val stereoSurfaceEntity = SurfaceEntity.create( session = xrSession, - stereoMode = SurfaceEntity.StereoMode.STEREO_MODE_SIDE_BY_SIDE, + stereoMode = SurfaceEntity.StereoMode.SIDE_BY_SIDE, pose = Pose(Vector3(0.0f, 0.0f, -1.5f)), shape = SurfaceEntity.Shape.Quad(FloatSize2d(1.0f, 1.0f)) ) @@ -61,7 +61,7 @@ private fun ComponentActivity.surfaceEntityCreateSbs(xrSession: Session) { val hemisphereStereoSurfaceEntity = SurfaceEntity.create( session = xrSession, - stereoMode = SurfaceEntity.StereoMode.STEREO_MODE_SIDE_BY_SIDE, + stereoMode = SurfaceEntity.StereoMode.SIDE_BY_SIDE, pose = xrSession.scene.spatialUser.head?.transformPoseTo( Pose.Identity, xrSession.scene.activitySpace @@ -78,7 +78,7 @@ private fun ComponentActivity.surfaceEntityCreateTb(xrSession: Session) { val sphereStereoSurfaceEntity = SurfaceEntity.create( session = xrSession, - stereoMode = SurfaceEntity.StereoMode.STEREO_MODE_TOP_BOTTOM, + stereoMode = SurfaceEntity.StereoMode.TOP_BOTTOM, pose = xrSession.scene.spatialUser.head?.transformPoseTo( Pose.Identity, xrSession.scene.activitySpace @@ -94,7 +94,7 @@ private fun ComponentActivity.surfaceEntityCreateMVHEVC(xrSession: Session) { // Create the SurfaceEntity with the StereoMode corresponding to the MV-HEVC content val stereoSurfaceEntity = SurfaceEntity.create( session = xrSession, - stereoMode = SurfaceEntity.StereoMode.STEREO_MODE_MULTIVIEW_LEFT_PRIMARY, + stereoMode = SurfaceEntity.StereoMode.MULTIVIEW_LEFT_PRIMARY, pose = Pose(Vector3(0.0f, 0.0f, -1.5f)), shape = SurfaceEntity.Shape.Quad(FloatSize2d(1.0f, 1.0f)) ) @@ -123,10 +123,10 @@ private fun ComponentActivity.surfaceEntityCreateDRM(xrSession: Session) { // Create the SurfaceEntity with the PROTECTED content security level. val protectedSurfaceEntity = SurfaceEntity.create( session = xrSession, - stereoMode = SurfaceEntity.StereoMode.STEREO_MODE_SIDE_BY_SIDE, + stereoMode = SurfaceEntity.StereoMode.SIDE_BY_SIDE, pose = Pose(Vector3(0.0f, 0.0f, -1.5f)), shape = SurfaceEntity.Shape.Quad(FloatSize2d(1.0f, 1.0f)), - surfaceProtection = SurfaceEntity.SurfaceProtection.SURFACE_PROTECTION_PROTECTED + surfaceProtection = SurfaceEntity.SurfaceProtection.PROTECTED ) // Build a MediaItem with the necessary DRM configuration. @@ -156,16 +156,16 @@ private fun ComponentActivity.surfaceEntityHDR(xrSession: Session) { // Define the color properties for your HDR video. These values should be specific // to your content. val hdrMetadata = SurfaceEntity.ContentColorMetadata( - colorSpace = SurfaceEntity.ContentColorMetadata.ColorSpace.COLOR_SPACE_BT2020, - colorTransfer = SurfaceEntity.ContentColorMetadata.ColorTransfer.COLOR_TRANSFER_ST2084, // PQ - colorRange = SurfaceEntity.ContentColorMetadata.ColorRange.COLOR_RANGE_LIMITED, + colorSpace = SurfaceEntity.ContentColorMetadata.ColorSpace.BT2020, + colorTransfer = SurfaceEntity.ContentColorMetadata.ColorTransfer.ST2084, // PQ + colorRange = SurfaceEntity.ContentColorMetadata.ColorRange.LIMITED, maxContentLightLevel = 1000 // Example: 1000 nits ) // Create a SurfaceEntity, passing the HDR metadata at creation time. val hdrSurfaceEntity = SurfaceEntity.create( session = xrSession, - stereoMode = SurfaceEntity.StereoMode.STEREO_MODE_MONO, + stereoMode = SurfaceEntity.StereoMode.MONO, pose = Pose(Vector3(0.0f, 0.0f, -1.5f)), shape = SurfaceEntity.Shape.Quad(FloatSize2d(1.0f, 1.0f)), ) From 74026e6a28aad8c6523f5cbccfbab297f89fcd68 Mon Sep 17 00:00:00 2001 From: amyZepp <134542280+amyZepp@users.noreply.github.com> Date: Wed, 3 Dec 2025 16:52:50 -0800 Subject: [PATCH 4/4] Update SpatialCapabilities.kt --- .../main/java/com/example/xr/scenecore/SpatialCapabilities.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xr/src/main/java/com/example/xr/scenecore/SpatialCapabilities.kt b/xr/src/main/java/com/example/xr/scenecore/SpatialCapabilities.kt index 6206893f2..96822bc71 100644 --- a/xr/src/main/java/com/example/xr/scenecore/SpatialCapabilities.kt +++ b/xr/src/main/java/com/example/xr/scenecore/SpatialCapabilities.kt @@ -32,7 +32,7 @@ fun checkMultipleCapabilities(xrSession: Session) { } // Example 2: multiple capability flags can be checked simultaneously: if (xrSession.scene.spatialCapabilities.contains(SpatialCapability.PASSTHROUGH_CONTROL) && - xrSession.scene.spatialCapabilities.contains(SPATIAL_3D_CONTENT) + xrSession.scene.spatialCapabilities.contains(SpatialCapability.SPATIAL_3D_CONTENT) ) { // ... }