BaseEntity
abstract class BaseEntity<RtEntityType : Entity> : BaseScenePose, Entity
ActivitySpace |
ActivitySpace is an |
AnchorEntity |
An AnchorEntity tracks a |
GltfModelEntity |
GltfModelEntity is a concrete implementation of Entity that hosts a glTF model. |
GroupEntity |
An |
PanelEntity |
PanelEntity contains an arbitrary 2D Android |
SurfaceEntity |
SurfaceEntity is an |
ActivityPanelEntity |
ActivityPanelEntity creates a spatial panel for embedding an |
MainPanelEntity |
Represents the main spatialized panel in a |
The BaseEntity is an implementation of Entity interface that wraps a platform entity.
Summary
Public functions |
|
|---|---|
open Unit |
Sets an Entity to be a child of this Entity in the scene graph. |
open Boolean |
addComponent(component: Component)Adds a Component to this Entity. |
open Unit |
dispose()Disposes of any system resources held by this Entity, and transitively calls dispose() on all its children. |
open Float |
Returns the alpha transparency set for this Entity, relative to given Space. |
open List<Component> |
Retrieves all components attached to this Entity. |
open List<T> |
<T : Component> getComponentsOfType(type: Class<T>)Retrieves all Components of the given type |
open Pose |
Returns the |
open Float |
Returns the scale of this entity, relative to given space. |
open Boolean |
Returns the enabled status of this Entity. |
open Unit |
Remove all components from this Entity. |
open Unit |
removeComponent(component: Component)Removes the given Component from this Entity. |
open Unit |
Sets the alpha transparency of the Entity relative to given Space. |
open Unit |
setEnabled(enabled: Boolean)Sets the local enabled state of this Entity. |
open Unit |
Sets the |
open Unit |
Sets the scale of this Entity relative to the given Space. |
Public properties |
|
|---|---|
open List<Entity> |
Provides the list of all children of this entity. |
open CharSequence |
Alternate text for this Entity to be consumed by Accessibility systems. |
open Entity? |
The parent of this Entity, from which this Entity will inherit most of its properties. |
Inherited functions |
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||
|
Public functions
addChild
open fun addChild(child: Entity): Unit
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.
addComponent
open fun addComponent(component: Component): Boolean
Adds a Component to this Entity.
| Parameters | |
|---|---|
component: Component |
the Component to be added to the Entity. |
| Returns | |
|---|---|
Boolean |
True if given Component was successfully added to the Entity. |
dispose
open fun dispose(): Unit
Disposes of any system resources held by this Entity, and transitively calls dispose() on all its children. Once disposed, this Entity is invalid and cannot be used again.
getAlpha
open fun getAlpha(relativeTo: Space): Float
Returns the alpha transparency set for this Entity, relative to given Space.
| Parameters | |
|---|---|
relativeTo: Space |
Gets alpha relative to given Space. Default value is the parent space. |
getComponents
open fun getComponents(): List<Component>
Retrieves all components attached to this Entity.
getComponentsOfType
open fun <T : Component> getComponentsOfType(type: Class<T>): List<T>
Retrieves all Components of the given type T and its sub-types attached to this Entity.
| Parameters | |
|---|---|
type: Class<T> |
The type of Component to retrieve. |
| Returns | |
|---|---|
List<T> |
List |
getPose
open fun getPose(relativeTo: Space): Pose
Returns the Pose for this Entity, relative to the provided Space.
| Parameters | |
|---|---|
relativeTo: Space |
Get the Pose relative to given Space. Default value is the parent space. |
getScale
open fun getScale(relativeTo: Space): Float
Returns the scale of this entity, relative to given space.
| Parameters | |
|---|---|
relativeTo: Space |
Get the scale relative to given Space. Default value is the parent space. |
| Returns | |
|---|---|
Float |
Current uniform scale applied to self and children. |
isEnabled
open fun isEnabled(includeParents: Boolean): Boolean
Returns the enabled status of this Entity.
| Parameters | |
|---|---|
includeParents: Boolean |
Whether to include the enabled status of parents in the returned value. |
| Returns | |
|---|---|
Boolean |
If includeParents is |
removeComponent
open fun removeComponent(component: Component): Unit
Removes the given Component from this Entity.
| Parameters | |
|---|---|
component: Component |
Component to be removed from this entity. |
setAlpha
open fun setAlpha(alpha: Float, relativeTo: Space): Unit
Sets the alpha transparency of the Entity relative to given 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.
Usage restrictions:
-
If the provided
alphais outside the 0, 1 range, it will be clamped automatically to 0, 1.
setEnabled
open fun setEnabled(enabled: Boolean): Unit
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 | |
|---|---|
enabled: Boolean |
The new local enabled state of this Entity. |
setPose
open fun setPose(pose: Pose, relativeTo: Space): Unit
Sets the Pose for this Entity. The Pose given is set relative to the Space provided.
Public properties
contentDescription
open var contentDescription: CharSequence
Alternate text for this Entity to be consumed by Accessibility systems.
parent
open var parent: Entity?
The parent of this Entity, from which this Entity will inherit most of its properties. For example, this Entity's 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.