SpatialCapabilities


public final class SpatialCapabilities


Representation of the spatial capabilities of the current Scene.

Summary

Constants

static final int

The activity can create 3D content.

static final int

The activity can set its own spatial environment.

static final int

The activity can spatially embed another activity.

static final int

The activity can enable or disable passthrough.

static final int

The activity can use spatial audio.

static final int

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

Public methods

boolean
equals(Object other)
final boolean
hasCapability(int capability)

Checks if one or more specified capabilities are available.

int
@NonNull String

Constants

SPATIAL_CAPABILITY_3D_CONTENT

public static final int SPATIAL_CAPABILITY_3D_CONTENT

The activity can create 3D content.

SPATIAL_CAPABILITY_APP_ENVIRONMENT

public static final int SPATIAL_CAPABILITY_APP_ENVIRONMENT

The activity can set its own spatial environment.

SPATIAL_CAPABILITY_EMBED_ACTIVITY

public static final int SPATIAL_CAPABILITY_EMBED_ACTIVITY

The activity can spatially embed another activity.

SPATIAL_CAPABILITY_PASSTHROUGH_CONTROL

public static final int SPATIAL_CAPABILITY_PASSTHROUGH_CONTROL

The activity can enable or disable passthrough.

SPATIAL_CAPABILITY_SPATIAL_AUDIO

public static final int SPATIAL_CAPABILITY_SPATIAL_AUDIO

The activity can use spatial audio.

SPATIAL_CAPABILITY_UI

public static final int SPATIAL_CAPABILITY_UI

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

Public methods

equals

public boolean equals(Object other)

hasCapability

Added in 1.0.0-alpha05
public final boolean hasCapability(int capability)

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
int capability

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

public int hashCode()

toString

public @NonNull String toString()