# 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)

*** ** * ** ***


```
public final class SpatialEnvironment.SpatialEnvironmentPreference
```

<br />

*** ** * ** ***

Represents the preferred spatial environment for the application.

The `https://developer.android.com/reference/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/androidx/xr/scenecore/SpatialEnvironment.SpatialEnvironmentPreference#SpatialEnvironmentPreference(androidx.xr.scenecore.ImageBasedLightingAsset,androidx.xr.scenecore.GltfModel)( https://developer.android.com/reference/androidx/xr/scenecore/ImageBasedLightingAsset imageBasedLightingAsset, https://developer.android.com/reference/androidx/xr/scenecore/GltfModel geometry )` Creates a preference for the `https://developer.android.com/reference/androidx/xr/scenecore/SpatialEnvironment`. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/xr/scenecore/SpatialEnvironment.SpatialEnvironmentPreference#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final https://developer.android.com/reference/androidx/xr/scenecore/GltfModel` | `https://developer.android.com/reference/androidx/xr/scenecore/SpatialEnvironment.SpatialEnvironmentPreference#getGeometry()()` The preferred geometry for the environment based on a pre-loaded `https://developer.android.com/reference/androidx/xr/scenecore/GltfModel`. |
| `final https://developer.android.com/reference/androidx/xr/scenecore/ImageBasedLightingAsset` | `https://developer.android.com/reference/androidx/xr/scenecore/SpatialEnvironment.SpatialEnvironmentPreference#getImageBasedLightingAsset()()` The preferred image-based lighting for the environment based on a pre-loaded `https://developer.android.com/reference/androidx/xr/scenecore/ImageBasedLightingAsset`. |
| `int` | `https://developer.android.com/reference/androidx/xr/scenecore/SpatialEnvironment.SpatialEnvironmentPreference#hashCode()()` |

## Public constructors

### SpatialEnvironmentPreference

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

```
public SpatialEnvironmentPreference(
    ImageBasedLightingAsset imageBasedLightingAsset,
    GltfModel geometry
)
```

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

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

## Public methods

### equals

```
public boolean equals(Object other)
```

### getGeometry

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

```
public final GltfModel getGeometry()
```

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

### getImageBasedLightingAsset

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

```
public final ImageBasedLightingAsset getImageBasedLightingAsset()
```

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

### hashCode

```
public int hashCode()
```