SpatialCapabilities


class SpatialCapabilities


Representation of the spatial capabilities of the current Scene.

Summary

Constants

const Int

The activity can create 3D content.

const Int

The activity can set its own spatial environment.

const Int

The activity can spatially embed another activity.

const Int

The activity can enable or disable passthrough.

const Int

The activity can use spatial audio.

const Int

The activity can spatialize itself by e.g. adding a spatial panel.

Public functions

open operator Boolean
equals(other: Any?)
Boolean
hasCapability(capability: Int)

Checks if one or more specified capabilities are available.

open Int
open String

Constants

SPATIAL_CAPABILITY_3D_CONTENT

const val SPATIAL_CAPABILITY_3D_CONTENTInt

The activity can create 3D content.

SPATIAL_CAPABILITY_APP_ENVIRONMENT

const val SPATIAL_CAPABILITY_APP_ENVIRONMENTInt

The activity can set its own spatial environment.

SPATIAL_CAPABILITY_EMBED_ACTIVITY

const val SPATIAL_CAPABILITY_EMBED_ACTIVITYInt

The activity can spatially embed another activity.

SPATIAL_CAPABILITY_PASSTHROUGH_CONTROL

const val SPATIAL_CAPABILITY_PASSTHROUGH_CONTROLInt

The activity can enable or disable passthrough.

SPATIAL_CAPABILITY_SPATIAL_AUDIO

const val SPATIAL_CAPABILITY_SPATIAL_AUDIOInt

The activity can use spatial audio.

SPATIAL_CAPABILITY_UI

const val SPATIAL_CAPABILITY_UIInt

The activity can spatialize itself by e.g. adding a spatial panel.

Public functions

equals

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

hasCapability

Added in 1.0.0-alpha05
fun hasCapability(capability: Int): Boolean

Checks if one or more specified capabilities are available.

This method tests if all of the provided capability flags are set.

Usage Examples

1. Checking for a single capability:

if (capabilities.hasCapability(SPATIAL_CAPABILITY_UI)) { // The session supports UI. }

2. Checking if all of a set of capabilities are available: To check if all capabilities from a set is available, combine the flags using a bitwise or.

if (capabilities.hasCapability(SPATIAL_CAPABILITY_UI or SPATIAL_CAPABILITY_3D_CONTENT)) {
// The session supports both UI and 3D content.
}
Parameters
capability: Int

The capability flag to check. This can be a single SPATIAL_CAPABILITY_* constant or multiple constants combined with a bitwise or.

Returns
Boolean

true if all of the specified capabilities is available, false otherwise.

hashCode

open fun hashCode(): Int

toString

open fun toString(): String