StereoSurfaceEntity


public final class StereoSurfaceEntity extends BaseEntity


StereoSurfaceEntity is a concrete implementation of Entity that hosts a StereoSurface Panel.

Summary

Nested types

public static class StereoSurfaceEntity.StereoMode

Public methods

final @NonNull Dimensions

Changes the width and height of the "spatial canvas" which the surface is mapped to.

final @NonNull Surface

Returns a surface into which the application can render stereo image content.

final void

Changes the width and height of the "spatial canvas" which the surface is mapped to.

Inherited methods

From androidx.xr.scenecore.ActivityPose
abstract @NonNull Pose

Returns the activity space pose for this ActivityPose.

abstract @NonNull Pose

Returns a pose relative to this ActivityPose transformed into a pose relative to the destination.

From androidx.xr.scenecore.BaseEntity
void

Sets an Entity to be represented in this coordinate space.

boolean

Adds a Component to this Entity.

void

Disposes of any system resources held by this Entity, and transitively calls dispose() on all its children.

float

Returns the global alpha of this entity computed by multiplying the parent's global alpha to this entity's local alpha.

float

Returns the alpha transparency set for this Entity.

@NonNull List<@NonNull Component>

Retrieves all components attached to this Entity.

@NonNull List<@NonNull T>

Retrieves all Components of the given type T and its sub-types attached to this Entity.

Entity

Returns the parent of this Entity.

@NonNull Pose

Returns the pose for this entity, relative to its parent.

float

Returns the local scale of this entity, not inclusive of the parent's scale.

@NonNull Dimensions

Returns the dimensions (in meters) for this Entity.

float

Returns the accumulated scale of this Entity.

boolean
isHidden(boolean includeParents)

Returns the hidden status of this Entity.

void

Remove all components from this Entity.

void

Removes the given Component from this Entity.

void
setAlpha(float alpha)

Sets the alpha transparency of the Entity and its children.

void

Sets alternate text for this entity to be consumed by Accessibility systems.

void
setHidden(boolean hidden)

Sets the local hidden state of this Entity.

void
setParent(Entity parent)

Sets this Entity to be represented in the parent's coordinate space.

void

Sets the pose for this Entity, relative to its parent.

void
setScale(float scale)

Sets the scale of this entity relative to its parent.

void
setSize(@NonNull Dimensions dimensions)

Sets the dimensions in pixels for the Entity.

Public methods

getDimensions

Added in 1.0.0-alpha01
public final @NonNull Dimensions getDimensions()

Changes the width and height of the "spatial canvas" which the surface is mapped to. (0,0,0) for this Entity is the canvas's center. (In unscaled ActivitySpace, this is 1 unit per meter) Width and height <= 0 are unsupported (Depth is ignored).

getSurface

Added in 1.0.0-alpha01
@MainThread
public final @NonNull Surface getSurface()

Returns a surface into which the application can render stereo image content.

This method must be called from the main thread. https://developer.android.com/guide/components/processes-and-threads

setDimensions

Added in 1.0.0-alpha01
public final void setDimensions(@NonNull Dimensions dimensions)

Changes the width and height of the "spatial canvas" which the surface is mapped to. (0,0,0) for this Entity is the canvas's center. (In unscaled ActivitySpace, this is 1 unit per meter) Width and height <= 0 are unsupported (Depth is ignored).