# Entity

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

*** ** * ** ***


```
public class Entity extends BaseScenePose<@NonNull androidx.xr.scenecore.runtime.ScenePose>
```

<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)\<@[NonNull](https://developer.android.com/reference/androidx/annotation/NonNull) androidx.xr.scenecore.runtime.ScenePose\> ||
|   | ↳ | [androidx.xr.scenecore.Entity](https://developer.android.com/reference/androidx/xr/scenecore/Entity) |

Known direct subclasses [GltfModelEntity](https://developer.android.com/reference/androidx/xr/scenecore/GltfModelEntity), [MeshEntity](https://developer.android.com/reference/androidx/xr/scenecore/MeshEntity), [PanelEntity](https://developer.android.com/reference/androidx/xr/scenecore/PanelEntity), [SpaceEntity](https://developer.android.com/reference/androidx/xr/scenecore/SpaceEntity), [SurfaceEntity](https://developer.android.com/reference/androidx/xr/scenecore/SurfaceEntity)

|---|---|
| `https://developer.android.com/reference/androidx/xr/scenecore/GltfModelEntity` | GltfModelEntity is a concrete implementation of Entity that hosts a glTF model. |
| `https://developer.android.com/reference/androidx/xr/scenecore/MeshEntity` | A renderable entity in the scene graph that renders a `https://developer.android.com/reference/androidx/xr/scenecore/CustomMesh`. |
| `https://developer.android.com/reference/androidx/xr/scenecore/PanelEntity` | PanelEntity contains an arbitrary 2D Android `https://developer.android.com/reference/android/view/View.html`, within a spatialized XR scene. |
| `https://developer.android.com/reference/androidx/xr/scenecore/SpaceEntity` | A SpaceEntity is a special Entity subtype whose position is independent of other SpaceEntity. |
| `https://developer.android.com/reference/androidx/xr/scenecore/SurfaceEntity` | SurfaceEntity is an `https://developer.android.com/reference/androidx/xr/scenecore/Entity` that hosts a `https://developer.android.com/reference/android/view/Surface.html`, which will be texture mapped onto the `https://developer.android.com/reference/androidx/xr/scenecore/SurfaceEntity.Shape`. |

Known indirect subclasses [ActivityPanelEntity](https://developer.android.com/reference/androidx/xr/scenecore/ActivityPanelEntity), [ActivitySpace](https://developer.android.com/reference/androidx/xr/scenecore/ActivitySpace), [AnchorSpace](https://developer.android.com/reference/androidx/xr/scenecore/AnchorSpace), [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/ActivitySpace` | ActivitySpace is a `https://developer.android.com/reference/androidx/xr/scenecore/SpaceEntity` used to track the system-managed pose and boundary of the volume associated with a spatialized Activity. |
| `https://developer.android.com/reference/androidx/xr/scenecore/AnchorSpace` | An AnchorSpace is a `https://developer.android.com/reference/androidx/xr/scenecore/SpaceEntity` tracks a `https://developer.android.com/reference/androidx/xr/runtime/math/Pose` relative to some position or surface in the "Real World." Children of this `https://developer.android.com/reference/androidx/xr/scenecore/SpaceEntity` will remain positioned relative to that location in the real world. |
| `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`. |

*** ** * ** ***

An Entity is the fundamental building block of a SceneCore `https://developer.android.com/reference/androidx/xr/scenecore/Scene`. Entities have a parent-child relationship with each other and are used to build a spatial scene graph.

There are several different Entity types with Entity being the base class. The position of most Entity types can be updated within the scene graph by updating their `https://developer.android.com/reference/androidx/xr/runtime/math/Pose`. Additionally, the Entity's scale, and alpha can be updated. Components can be attached to Entities to enable additional behaviors.

There are several subtypes of Entities. These include Entities with special positions, (e.g. `https://developer.android.com/reference/androidx/xr/scenecore/ActivitySpace` and `https://developer.android.com/reference/androidx/xr/scenecore/AnchorSpace`) as well as those which are used to render different types of content (e.g. `https://developer.android.com/reference/androidx/xr/scenecore/PanelEntity` and `https://developer.android.com/reference/androidx/xr/scenecore/GltfModelEntity`).

## Summary

| ### Public methods |
|---|---|
| `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. |
| `static final @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#create(androidx.xr.runtime.Session,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/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 )` Public factory method for creating an `https://developer.android.com/reference/androidx/xr/scenecore/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. |

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

## Public methods

### addChild

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

```
public final void addChild(@NonNull Entity child)
```

Sets an Entity to be a child of this Entity in the scene graph. The child Entity will inherit properties from the parent, and will be represented in the parent's coordinate space. From a user's perspective, as this Entity moves, the child Entity will move with it.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Entity child` | The `https://developer.android.com/reference/androidx/xr/scenecore/Entity` to be attached. |

### addComponent

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

```
public final boolean addComponent(@NonNull Component component)
```

Adds a Component to this Entity.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Component component` | the Component to be added to the Entity. |

| Returns |
|---|---|
| `boolean` | True if given Component was successfully added to the Entity. This can be false for certain components if an Entity already has a component of that type or does not support the component type. |

### create

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

```
public static final @NonNull Entity create(
    @NonNull Session session,
    String name,
    @NonNull Pose pose,
    Entity parent
)
```

Public factory method for creating an `https://developer.android.com/reference/androidx/xr/scenecore/Entity`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/Session session` | Session to create the Entity in. |
| `https://developer.android.com/reference/java/lang/String.html name` | Name of the entity. This is unset by default. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Pose pose` | Initial pose of the entity. The default value is `https://developer.android.com/reference/androidx/xr/runtime/math/Pose#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. |

### getAlpha

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

```
public final @FloatRange(from = 0.0, to = 1.0) float getAlpha(@NonNull Space relativeTo)
```

Returns the alpha transparency set for this Entity, relative to given Space.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Space relativeTo` | Gets alpha relative to given Space. Default value is the parent space. |

### getChildren

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

```
public final @NonNull List<@NonNull Entity> getChildren()
```

Provides the list of all children of this entity. Adding children can be done using `https://developer.android.com/reference/androidx/xr/scenecore/Entity#addChild(androidx.xr.scenecore.Entity)` or by setting the `https://developer.android.com/reference/androidx/xr/scenecore/Entity#parent()` property of the child Entity. To remove a child, set the child's `https://developer.android.com/reference/androidx/xr/scenecore/Entity#parent()` property to another Entity or `null`.

| Returns |
|---|---|
| `@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>` | List of all children of this entity. |

### getComponents

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

```
public final @NonNull List<@NonNull Component> getComponents()
```

Retrieves all components attached to this Entity.

| Returns |
|---|---|
| `@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>` | List attached to this Entity. |

### getComponentsOfType

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

```
public final @NonNull List<@NonNull T> <T extends Component> getComponentsOfType(@NonNull Class<@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.

| Parameters |
|---|---|
| `@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` | The type of Component to retrieve. |

| Returns |
|---|---|
| `@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>` | List of the given type attached to this Entity. This list will be empty if no components of the given type are attached to this Entity. |

### getContentDescription

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

```
public final @NonNull CharSequence getContentDescription()
```

Alternate text for this Entity to be consumed by Accessibility systems.

### getParent

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

```
public Entity getParent()
```

The parent of this Entity, from which this Entity will inherit most of its properties. For example, this Entity's `https://developer.android.com/reference/androidx/xr/runtime/math/Pose` is defined in relation to the parent Entity's coordinate space, so as the parent moves, this Entity will move with it. Setting the parent to `null` will remove the Entity from the scene graph.

### getPose

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

```
public @NonNull Pose getPose(@NonNull 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`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Space relativeTo` | Get the Pose relative to given Space. Default value is the parent space. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Pose` | Current `https://developer.android.com/reference/androidx/xr/runtime/math/Pose` of the Entity relative to the given space. |

### getScale

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

```
public @FloatRange(from = 0.0) float getScale(@NonNull Space relativeTo)
```

Returns the scale of this entity, relative to given space.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Space relativeTo` | Get the scale relative to given Space. Default value is the parent space. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0) float` | Current uniform scale applied to self and children. |

### isEnabled

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

```
public final boolean isEnabled(boolean includeParents)
```

Returns the enabled status of this Entity.

If `includeParents` is `true`, the returned value will be `false` if this Entity or any of its ancestors is disabled. If `includeParents` is `false`, the local enabled state is returned. Regardless of the local enabled state, an Entity will be considered disabled if any of its ancestors are disabled.

| Parameters |
|---|---|
| `boolean includeParents` | Whether to include the enabled status of parents in the returned value. |

| Returns |
|---|---|
| `boolean` | True if this Entity is enabled, possibly including the enabled status of its parents. |

### removeAllComponents

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

```
public final void removeAllComponents()
```

Remove all components from this Entity.

### removeComponent

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

```
public final void removeComponent(@NonNull Component component)
```

Removes the given Component from this Entity.

### setAlpha

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

```
public final void setAlpha(@FloatRange(from = 0.0, to = 1.0) float alpha)
```

Sets the alpha transparency of the Entity relative to the parent Space. Values are in the range 0, 1 with 0 being fully transparent and 1 being fully opaque.

This value will affect the rendering of this Entity's children. Children of this node will have their alpha levels multiplied by this value and any alpha of this Entity's ancestors. As a result, the effective alpha of a child cannot exceed the effective alpha of its parent.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0, to = 1.0) float alpha` | Alpha transparency level for the Entity. |

### setContentDescription

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

```
public final void setContentDescription(@NonNull CharSequence value)
```

Alternate text for this Entity to be consumed by Accessibility systems.

### setEnabled

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

```
public final void setEnabled(boolean enabled)
```

Sets the local enabled state of this Entity.

When `false`, this Entity and all descendants will not be rendered in the scene, and the Entity will not respond to input events. If an Entity's local enabled state is `true`, the Entity will still be considered not enabled if at least one of its ancestors is not enabled.

| Parameters |
|---|---|
| `boolean enabled` | The new local enabled state of this Entity. |

### setParent

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

```
public void setParent(Entity value)
```

The parent of this Entity, from which this Entity will inherit most of its properties. For example, this Entity's `https://developer.android.com/reference/androidx/xr/runtime/math/Pose` is defined in relation to the parent Entity's coordinate space, so as the parent moves, this Entity will move with it. Setting the parent to `null` will remove the Entity from the scene graph.

### setPose

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

```
public void setPose(@NonNull Pose pose, @NonNull Space relativeTo)
```

Sets the `https://developer.android.com/reference/androidx/xr/runtime/math/Pose` for this Entity. The Pose given is set relative to the `https://developer.android.com/reference/androidx/xr/scenecore/Space` provided.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/math/Pose pose` | The `https://developer.android.com/reference/androidx/xr/runtime/math/Pose` offset from the parent. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Space relativeTo` | Set the pose relative to given Space. Default value is the parent space. |

### setScale

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

```
public void setScale(@FloatRange(from = 0.0) float scale, @NonNull Space relativeTo)
```

Sets the scale of this Entity relative to the given Space. This value will affect the rendering of this Entity's children. As the scale increases, this will uniformly stretch the content of the Entity.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/FloatRange(from = 0.0) float scale` | The uniform scale factor. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/Space relativeTo` | Set the scale relative to given Space. Default value is the parent Space. |