# SpatialEnvironment.SpatialEnvironmentPreference

Artifact: [androidx.xr.scenecore:scenecore](https://developer.android.com/jetpack/androidx/releases/xr-scenecore) [View Source](https://cs.android.com/search?q=file:androidx/xr/scenecore/SpatialEnvironment.kt+class:androidx.xr.scenecore.SpatialEnvironment.SpatialEnvironmentPreference) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

*** ** * ** ***


```
class SpatialEnvironment.SpatialEnvironmentPreference
```

<br />

*** ** * ** ***

Represents the preferred spatial environment for the application.

The `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SpatialEnvironment.SpatialEnvironmentPreference` can consist of image-based lighting and geometry. Setting the image-based lighting to `null` will result in no lighting for the scene, and setting the geometry to `null` will result in black void environment.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SpatialEnvironment.SpatialEnvironmentPreference#SpatialEnvironmentPreference(androidx.xr.scenecore.ImageBasedLightingAsset,androidx.xr.scenecore.GltfModel)( imageBasedLightingAsset: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/ImageBasedLightingAsset?, geometry: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/GltfModel? )` Creates a preference for the `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SpatialEnvironment`. |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SpatialEnvironment.SpatialEnvironmentPreference#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SpatialEnvironment.SpatialEnvironmentPreference#hashCode()()` |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/GltfModel?` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SpatialEnvironment.SpatialEnvironmentPreference#geometry()` The preferred geometry for the environment based on a pre-loaded `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/GltfModel`. |
| `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/ImageBasedLightingAsset?` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SpatialEnvironment.SpatialEnvironmentPreference#imageBasedLightingAsset()` The preferred image-based lighting for the environment based on a pre-loaded `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/ImageBasedLightingAsset`. |

## Public constructors

### SpatialEnvironmentPreference

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
SpatialEnvironmentPreference(
    imageBasedLightingAsset: ImageBasedLightingAsset?,
    geometry: GltfModel?
)
```

Creates a preference for the `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SpatialEnvironment`.

| Parameters |
|---|---|
| `imageBasedLightingAsset: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/ImageBasedLightingAsset?` | The preferred image-based lighting for the environment. |
| `geometry: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/GltfModel?` | The preferred geometry for the environment. |

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

```
open fun hashCode(): Int
```

## Public properties

### geometry

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
val geometry: GltfModel?
```

The preferred geometry for the environment based on a pre-loaded `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/GltfModel`. The geometry can include a skybox texture for the horizon of the environment.

### imageBasedLightingAsset

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
val imageBasedLightingAsset: ImageBasedLightingAsset?
```

The preferred image-based lighting for the environment based on a pre-loaded `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/ImageBasedLightingAsset`. This lighting contributes to the overall illumination and reflections within the scene.