# PanelEntity

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/PanelEntity.kt+class:androidx.xr.scenecore.PanelEntity) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

*** ** * ** ***


```
public class PanelEntity extends Entity
```

<br />

|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||||
| ↳ | [androidx.xr.scenecore.BaseScenePose](https://developer.android.com/reference/androidx/xr/scenecore/BaseScenePose) |||
|   | ↳ | [androidx.xr.scenecore.Entity](https://developer.android.com/reference/androidx/xr/scenecore/Entity) ||
|   |   | ↳ | [androidx.xr.scenecore.PanelEntity](https://developer.android.com/reference/androidx/xr/scenecore/PanelEntity) |

Known direct subclasses [ActivityPanelEntity](https://developer.android.com/reference/androidx/xr/scenecore/ActivityPanelEntity), [MainPanelEntity](https://developer.android.com/reference/androidx/xr/scenecore/MainPanelEntity)

|---|---|
| `https://developer.android.com/reference/androidx/xr/scenecore/ActivityPanelEntity` | ActivityPanelEntity creates a spatial panel for embedding an `https://developer.android.com/reference/android/app/Activity.html` in Android XR. |
| `https://developer.android.com/reference/androidx/xr/scenecore/MainPanelEntity` | Represents the main spatialized panel in a `https://developer.android.com/reference/androidx/xr/scenecore/Scene`. |

*** ** * ** ***

PanelEntity contains an arbitrary 2D Android `https://developer.android.com/reference/android/view/View.html`, within a spatialized XR scene.

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/PanelEntity` | `https://developer.android.com/reference/androidx/xr/scenecore/PanelEntity#create(androidx.xr.runtime.Session,android.view.View,androidx.xr.runtime.math.FloatSize2d,kotlin.String,androidx.xr.runtime.math.Pose,androidx.xr.scenecore.Entity)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/Session session, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/View.html view, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d dimensions, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html name, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Pose pose, https://developer.android.com/reference/androidx/xr/scenecore/Entity parent )` Factory method for a spatialized PanelEntity. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/PanelEntity` | `https://developer.android.com/reference/androidx/xr/scenecore/PanelEntity#create(androidx.xr.runtime.Session,android.view.View,androidx.xr.runtime.math.IntSize2d,kotlin.String,androidx.xr.runtime.math.Pose,androidx.xr.scenecore.Entity)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/Session session, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/View.html view, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/IntSize2d pixelDimensions, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html name, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Pose pose, https://developer.android.com/reference/androidx/xr/scenecore/Entity parent )` Factory method for a spatialized PanelEntity. |
| `final float` | `https://developer.android.com/reference/androidx/xr/scenecore/PanelEntity#getCornerRadius()()` The corner radius of the PanelEntity, in meters. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/PerceivedResolutionResult` | `https://developer.android.com/reference/androidx/xr/scenecore/PanelEntity#getPerceivedResolution(androidx.xr.arcore.RenderViewpoint)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/arcore/RenderViewpoint renderViewpoint)` Gets the perceived resolution of this Entity in the provided `https://developer.android.com/reference/androidx/xr/arcore/RenderViewpoint`. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d` | `https://developer.android.com/reference/androidx/xr/scenecore/PanelEntity#getSize()()` The dimensions of this PanelEntity in local space, in units relative to the scale of this Entity's parent. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/IntSize2d` | `https://developer.android.com/reference/androidx/xr/scenecore/PanelEntity#getSizeInPixels()()` The dimensions of this PanelEntity, in pixels, which is the resolution of the underlying surface. |
| `final boolean` | `https://developer.android.com/reference/androidx/xr/scenecore/PanelEntity#isMainPanelEntity()()` True if this panel is the [MainPanelEntity](https://developer.android.com/develop/xr/jetpack-xr-sdk/work-with-entities), false otherwise. |
| `final void` | `https://developer.android.com/reference/androidx/xr/scenecore/PanelEntity#setCornerRadius(kotlin.Float)(float value)` The corner radius of the PanelEntity, in meters. |
| `final void` | `https://developer.android.com/reference/androidx/xr/scenecore/PanelEntity#setSize(androidx.xr.runtime.math.FloatSize2d)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d value)` The dimensions of this PanelEntity in local space, in units relative to the scale of this Entity's parent. |
| `final void` | `https://developer.android.com/reference/androidx/xr/scenecore/PanelEntity#setSizeInPixels(androidx.xr.runtime.math.IntSize2d)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/IntSize2d value)` The dimensions of this PanelEntity, in pixels, which is the resolution of the underlying surface. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/androidx/xr/scenecore/PanelEntity#transformNormalizedCoordinatesToLocalPosition(androidx.xr.runtime.math.Vector2)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Vector2 coordinates )` Gets the 3D position of a 2D normalized extent coordinate within the entity's local space. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/androidx/xr/scenecore/PanelEntity#transformPixelCoordinatesToLocalPosition(androidx.xr.runtime.math.Vector2)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Vector2 coordinates)` Gets the 3D position of a 2D pixel coordinate within the entity's local space. |

### Inherited methods

From [androidx.xr.scenecore.BaseScenePose](https://developer.android.com/reference/androidx/xr/scenecore/BaseScenePose) `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Pose` `https://developer.android.com/reference/androidx/xr/scenecore/BaseScenePose#getPoseInActivitySpace()()`

The current `https://developer.android.com/reference/androidx/xr/runtime/math/Pose` relative to the activity space root.
`https://developer.android.com/reference/androidx/xr/scenecore/HitTestResult` `https://developer.android.com/reference/androidx/xr/scenecore/BaseScenePose#hitTest(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Vector3 origin, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Vector3 direction)`

Perform a hit test from the specified origin in the specified direction into the Scene.
`https://developer.android.com/reference/androidx/xr/scenecore/HitTestResult` `https://developer.android.com/reference/androidx/xr/scenecore/BaseScenePose#hitTest(androidx.xr.runtime.math.Vector3,androidx.xr.runtime.math.Vector3,kotlin.Int)(
@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Vector3 origin,
@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Vector3 direction,
int hitTestFilter
)`

Creates a hit test from the specified origin in the specified direction into the scene.
`@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Vector3` `https://developer.android.com/reference/androidx/xr/scenecore/BaseScenePose#transformDirectionTo(androidx.xr.runtime.math.Vector3,androidx.xr.scenecore.ScenePose)(
@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Vector3 direction,
@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/ScenePose destination
)`

Transforms a direction from this ScenePose's local space to the destination ScenePose's local space.
`@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Pose` `https://developer.android.com/reference/androidx/xr/scenecore/BaseScenePose#transformPoseTo(androidx.xr.runtime.math.Pose,androidx.xr.scenecore.ScenePose)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Pose pose, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/ScenePose destination)`

Returns a `https://developer.android.com/reference/androidx/xr/runtime/math/Pose` relative to this ScenePose, transformed into a Pose relative to the destination.
`@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Vector3` `https://developer.android.com/reference/androidx/xr/scenecore/BaseScenePose#transformPositionTo(androidx.xr.runtime.math.Vector3,androidx.xr.scenecore.ScenePose)(
@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Vector3 position,
@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/ScenePose destination
)`

Transforms a position from this ScenePose's local space to the destination ScenePose's local space.
`@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Vector3` `https://developer.android.com/reference/androidx/xr/scenecore/BaseScenePose#transformVectorTo(androidx.xr.runtime.math.Vector3,androidx.xr.scenecore.ScenePose)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Vector3 vector, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/ScenePose destination)`

Transforms a vector from this ScenePose's local space to the destination ScenePose's local space.
From [androidx.xr.scenecore.Entity](https://developer.android.com/reference/androidx/xr/scenecore/Entity) `final void` `https://developer.android.com/reference/androidx/xr/scenecore/Entity#addChild(androidx.xr.scenecore.Entity)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Entity child)`

Sets an Entity to be a child of this Entity in the scene graph.
`final boolean` `https://developer.android.com/reference/androidx/xr/scenecore/Entity#addComponent(androidx.xr.scenecore.Component)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Component component)`

Adds a Component to this Entity.
`final @https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0, to = 1.0) float` `https://developer.android.com/reference/androidx/xr/scenecore/Entity#getAlpha(androidx.xr.scenecore.Space)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Space relativeTo)`

Returns the alpha transparency set for this Entity, relative to given Space.
`final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Entity>` `https://developer.android.com/reference/androidx/xr/scenecore/Entity#getChildren()()`

Provides the list of all children of this entity.
`final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Component>` `https://developer.android.com/reference/androidx/xr/scenecore/Entity#getComponents()()`

Retrieves all components attached to this Entity.
`final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull T>` `<T extends https://developer.android.com/reference/androidx/xr/scenecore/Component> https://developer.android.com/reference/androidx/xr/scenecore/Entity#getComponentsOfType(java.lang.Class)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Class.html<@https://developer.android.com/reference/androidx/annotation/NonNull T> type)`

Retrieves all Components of the given type `https://developer.android.com/reference/androidx/xr/scenecore/Entity#getComponentsOfType(java.lang.Class)` and its subtypes attached to this Entity.
`final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/CharSequence.html` `https://developer.android.com/reference/androidx/xr/scenecore/Entity#getContentDescription()()`

Alternate text for this Entity to be consumed by Accessibility systems.
`https://developer.android.com/reference/androidx/xr/scenecore/Entity` `https://developer.android.com/reference/androidx/xr/scenecore/Entity#getParent()()`

The parent of this Entity, from which this Entity will inherit most of its properties.
`@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Pose` `https://developer.android.com/reference/androidx/xr/scenecore/Entity#getPose(androidx.xr.scenecore.Space)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Space relativeTo)`

Returns the `https://developer.android.com/reference/androidx/xr/runtime/math/Pose` for this Entity, relative to the provided `https://developer.android.com/reference/androidx/xr/scenecore/Space`.
`@https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0) float` `https://developer.android.com/reference/androidx/xr/scenecore/Entity#getScale(androidx.xr.scenecore.Space)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Space relativeTo)`

Returns the scale of this entity, relative to given space.
`final boolean` `https://developer.android.com/reference/androidx/xr/scenecore/Entity#isEnabled(kotlin.Boolean)(boolean includeParents)`

Returns the enabled status of this Entity.
`final void` `https://developer.android.com/reference/androidx/xr/scenecore/Entity#removeAllComponents()()`

Remove all components from this Entity.
`final void` `https://developer.android.com/reference/androidx/xr/scenecore/Entity#removeComponent(androidx.xr.scenecore.Component)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Component component)`

Removes the given Component from this Entity.
`final void` `https://developer.android.com/reference/androidx/xr/scenecore/Entity#setAlpha(kotlin.Float)(@https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0, to = 1.0) float alpha)`

Sets the alpha transparency of the Entity relative to the parent Space.
`final void` `https://developer.android.com/reference/androidx/xr/scenecore/Entity#setContentDescription(kotlin.CharSequence)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/CharSequence.html value)`

Alternate text for this Entity to be consumed by Accessibility systems.
`final void` `https://developer.android.com/reference/androidx/xr/scenecore/Entity#setEnabled(kotlin.Boolean)(boolean enabled)`

Sets the local enabled state of this Entity.
`void` `https://developer.android.com/reference/androidx/xr/scenecore/Entity#setParent(androidx.xr.scenecore.Entity)(https://developer.android.com/reference/androidx/xr/scenecore/Entity value)`

The parent of this Entity, from which this Entity will inherit most of its properties.
`void` `https://developer.android.com/reference/androidx/xr/scenecore/Entity#setPose(androidx.xr.runtime.math.Pose,androidx.xr.scenecore.Space)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Pose pose, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Space relativeTo)`

Sets the `https://developer.android.com/reference/androidx/xr/runtime/math/Pose` for this Entity.
`void` `https://developer.android.com/reference/androidx/xr/scenecore/Entity#setScale(kotlin.Float,androidx.xr.scenecore.Space)(@https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0) float scale, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Space relativeTo)`

Sets the scale of this Entity relative to the given Space.

## Public methods

### create

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

```
public static final @NonNull PanelEntity create(
    @NonNull Session session,
    @NonNull View view,
    @NonNull FloatSize2d dimensions,
    @NonNull String name,
    @NonNull Pose pose,
    Entity parent
)
```

Factory method for a spatialized PanelEntity.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/Session session` | XR `https://developer.android.com/reference/androidx/xr/runtime/Session` in which to create the PanelEntity. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/View.html view` | `https://developer.android.com/reference/android/view/View.html` to embed in this panel entity. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/FloatSize2d dimensions` | Spatialized dimensions for the underlying surface for the given view, in meters. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html name` | Name of this PanelEntity. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Pose pose` | `https://developer.android.com/reference/androidx/xr/runtime/math/Pose` of this entity relative to its parent, default value is Identity. |
| `https://developer.android.com/reference/androidx/xr/scenecore/Entity parent` | Parent entity. Defaults to `null`. If `null`, the entity is created but not attached to the scene graph, meaning it will be invisible. If a parent entity (e.g., `https://developer.android.com/reference/androidx/xr/scenecore/ActivitySpace` or any other `https://developer.android.com/reference/androidx/xr/scenecore/Entity` already present in the scene) is assigned later, the entity will become visible (provided it is enabled). This allows for `https://developer.android.com/reference/androidx/xr/scenecore/Entity` pre-configuration before making it visible. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/PanelEntity` | a PanelEntity instance. |

### create

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

```
public static final @NonNull PanelEntity create(
    @NonNull Session session,
    @NonNull View view,
    @NonNull IntSize2d pixelDimensions,
    @NonNull String name,
    @NonNull Pose pose,
    Entity parent
)
```

Factory method for a spatialized PanelEntity.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/Session session` | XR `https://developer.android.com/reference/androidx/xr/runtime/Session` in which to create the PanelEntity. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/View.html view` | `https://developer.android.com/reference/android/view/View.html` to embed in this panel entity. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/IntSize2d pixelDimensions` | Dimensions for the underlying surface for the given view, in pixels. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html name` | Name of the panel. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Pose pose` | `https://developer.android.com/reference/androidx/xr/runtime/math/Pose` of this PanelEntity relative to its parent, default value is Identity. |
| `https://developer.android.com/reference/androidx/xr/scenecore/Entity parent` | Parent entity. Defaults to `null`. If `null`, the entity is created but not attached to the scene graph, meaning it will be invisible. If a parent entity (e.g., `https://developer.android.com/reference/androidx/xr/scenecore/ActivitySpace` or any other `https://developer.android.com/reference/androidx/xr/scenecore/Entity` already present in the scene) is assigned later, the entity will become visible (provided it is enabled). This allows for `https://developer.android.com/reference/androidx/xr/scenecore/Entity` pre-configuration before making it visible. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/PanelEntity` | a PanelEntity instance. |

### getCornerRadius

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

```
public final float getCornerRadius()
```

The corner radius of the PanelEntity, in meters.

### getPerceivedResolution

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

```
public final @NonNull PerceivedResolutionResult getPerceivedResolution(@NonNull RenderViewpoint renderViewpoint)
```

Gets the perceived resolution of this Entity in the provided `https://developer.android.com/reference/androidx/xr/arcore/RenderViewpoint`.

This API is only intended for use in Full Space and will return `https://developer.android.com/reference/androidx/xr/scenecore/PerceivedResolutionResult.InvalidRenderViewpoint` in Home Space. For applications requiring perceived resolution in Home Space, see `https://developer.android.com/reference/androidx/xr/scenecore/PanelEntity#getPerceivedResolution(androidx.xr.arcore.RenderViewpoint)`.

This value represents the dimensions of the Entity on the camera view if its largest surface was facing the camera without changing the distance of the Entity to the camera. This can be used by clients to dynamically optimize the resolution of assets within the PanelEntity, for example by using lower-resolution assets within panels that are further from the viewer. The Entity's own rotation and the camera's viewing direction are disregarded.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/arcore/RenderViewpoint renderViewpoint` | that provides the pose and field-of-view of the camera. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/PerceivedResolutionResult` | A `https://developer.android.com/reference/androidx/xr/scenecore/PerceivedResolutionResult` which encapsulates the outcome: - `https://developer.android.com/reference/androidx/xr/scenecore/PerceivedResolutionResult.Success` containing the if the calculation is successful. - `https://developer.android.com/reference/androidx/xr/scenecore/PerceivedResolutionResult.EntityTooClose` if the Entity is too close to the camera. - `https://developer.android.com/reference/androidx/xr/scenecore/PerceivedResolutionResult.InvalidRenderViewpoint` if the camera information required for the calculation is invalid or unavailable. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/xr/scenecore/PerceivedResolutionResult` |   |

### getSize

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

```
public final @NonNull FloatSize2d getSize()
```

The dimensions of this PanelEntity in local space, in units relative to the scale of this Entity's parent.

### getSizeInPixels

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

```
public final @NonNull IntSize2d getSizeInPixels()
```

The dimensions of this PanelEntity, in pixels, which is the resolution of the underlying surface.

This API doesn't do any scale compensation to the pixel dimensions.

### isMainPanelEntity

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

```
public final boolean isMainPanelEntity()
```

True if this panel is the [MainPanelEntity](https://developer.android.com/develop/xr/jetpack-xr-sdk/work-with-entities), false otherwise.

### setCornerRadius

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

```
public final void setCornerRadius(float value)
```

The corner radius of the PanelEntity, in meters.

### setSize

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

```
public final void setSize(@NonNull FloatSize2d value)
```

The dimensions of this PanelEntity in local space, in units relative to the scale of this Entity's parent.

### setSizeInPixels

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

```
public final void setSizeInPixels(@NonNull IntSize2d value)
```

The dimensions of this PanelEntity, in pixels, which is the resolution of the underlying surface.

This API doesn't do any scale compensation to the pixel dimensions.

### transformNormalizedCoordinatesToLocalPosition

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

```
public final @NonNull Vector3 transformNormalizedCoordinatesToLocalPosition(
    @NonNull Vector2 coordinates
)
```

Gets the 3D position of a 2D normalized extent coordinate within the entity's local space.

This method's inputs use a 2D normalized coordinate system where:

- The origin (0.0, 0.0) is at the **center** of the panel.

- The +X axis points towards the **right** edge (mapped to 1.0) of the panel content.

- The +Y axis points towards the **top** edge (mapped to 1.0) of the panel content.

Values outside the -1.0, 1.0 range are permitted and will result in a position outside the panel's surface.

Note that calling this method on `https://developer.android.com/reference/androidx/xr/scenecore/MainPanelEntity` during `https://developer.android.com/reference/android/app/Activity.html#onCreate(android.os.Bundle)` can result in incorrect values.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Vector2 coordinates` | The normalized coordinates, relative to the origin at the center of the panel. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Vector3` | The 3D position in the Entity's local space corresponding to the 2D normalized coordinate. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/xr/scenecore/ScenePose#transformPositionTo(androidx.xr.runtime.math.Vector3,androidx.xr.scenecore.ScenePose)` | to transform the position to a different coordinate space. |

### transformPixelCoordinatesToLocalPosition

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

```
public final @NonNull Vector3 transformPixelCoordinatesToLocalPosition(@NonNull Vector2 coordinates)
```

Gets the 3D position of a 2D pixel coordinate within the entity's local space.

This method's inputs use a 2D pixel coordinate system where:

- The origin (0, 0) is at the **top-left** corner of the panel.

- The +X axis points towards the **right** edge of the panel content.

- The +Y axis points towards the **bottom** edge of the panel content.

Input values are floats to allow for sub-pixel accuracy. Values outside the panel's pixel dimensions (e.g., `x < 0` or `y > panelHeight`) are permitted and will result in a position outside the panel's surface.

Note that calling this method on `https://developer.android.com/reference/androidx/xr/scenecore/MainPanelEntity` during `https://developer.android.com/reference/android/app/Activity.html#onCreate(android.os.Bundle)` can result in incorrect values.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Vector2 coordinates` | The pixel coordinate, relative to the top-left origin. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Vector3` | The 3D position in the Entity's local space corresponding to the 2D pixel coordinate. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/xr/scenecore/ScenePose#transformPositionTo(androidx.xr.runtime.math.Vector3,androidx.xr.scenecore.ScenePose)` | to transform the position to a different coordinate space. |