JxrPlatformAdapter.Entity


interface JxrPlatformAdapter.Entity : JxrPlatformAdapter.ActivityPose

Known direct subclasses
JxrPlatformAdapter.GltfEntity

Interface for a SceneCore [GltfEntity].

JxrPlatformAdapter.LoggingEntity

Interface for a SceneCore Entity that only logs the pose.

JxrPlatformAdapter.PanelEntity

Interface for a SceneCore Panel entity

JxrPlatformAdapter.StereoSurfaceEntity

Interface for a surface which images can be rendered into.

JxrPlatformAdapter.SystemSpaceEntity

Interface for a system-controlled SceneCore Entity that defines its own coordinate space.

Known indirect subclasses
JxrPlatformAdapter.ActivityPanelEntity

Interface for a SceneCore ActivityPanel entity.

JxrPlatformAdapter.ActivitySpace

Interface for a SceneCore activity space.

JxrPlatformAdapter.AnchorEntity

Interface for Anchor entity.


Interface for a SceneCore Entity

Summary

Public functions

Unit

Add given Entity as child.

Unit

Sets the provided Entities to be children of the Entity.

Boolean

Add these components to entity.

Unit

Adds the listener to the set of active input listeners, for input events targeted to this entity or its child entities.

Unit

Dispose any system resources held by this entity, and transitively calls dispose() on all the children.

Float

Returns the total alpha transparency level for this Entity.

Float

Returns the set alpha transparency level for this Entity.

(Mutable)List<JxrPlatformAdapter.Entity!>

Returns the all child entities of this Entity.

JxrPlatformAdapter.Entity?

Returns the parent entity for this Entity.

Pose

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

Vector3

Returns the scale of this entity, relative to its parent.

Boolean
isHidden(includeParents: Boolean)

Returns the hidden status of this Entity.

Unit

Remove all components from this entity.

Unit

Remove the given component from the entity.

Unit

Removes the given listener from the set of active input listeners.

Unit
setAlpha(alpha: Float)

Sets the alpha transparency for the given Entity.

Unit

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

Unit
setHidden(hidden: Boolean)

Sets the local hidden state of this Entity.

Unit

Sets the parent Entity for this Entity.

Unit
setPose(pose: Pose)

Updates the pose (position and rotation) of the Entity relative to its parent.

Unit
setScale(scale: Vector3)

Sets the scale of this entity relative to its parent.

Unit

Sets the size for the given Entity.

Inherited functions

From androidx.xr.scenecore.JxrPlatformAdapter.ActivityPose
Pose

Returns the pose for this entity, relative to the activity space root.

Vector3

Returns the scale of this WorldPose relative to the activity space.

Vector3

Returns the scale of this ActivityPose.

Pose

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

Public functions

addChild

Added in 1.0.0-alpha02
fun addChild(child: JxrPlatformAdapter.Entity): Unit

Add given Entity as child. The child Entity's pose will be relative to the pose of its parent

Parameters
child: JxrPlatformAdapter.Entity

The child entity.

addChildren

Added in 1.0.0-alpha02
fun addChildren(children: (Mutable)List<JxrPlatformAdapter.Entity!>): Unit

Sets the provided Entities to be children of the Entity.

addComponent

Added in 1.0.0-alpha02
fun addComponent(component: JxrPlatformAdapter.Component): Boolean

Add these components to entity.

Parameters
component: JxrPlatformAdapter.Component

Component to add to the Entity.

Returns
Boolean

True if the given component is added to the Entity.

addInputEventListener

Added in 1.0.0-alpha02
fun addInputEventListener(
    executor: Executor,
    listener: JxrPlatformAdapter.InputEventListener
): Unit

Adds the listener to the set of active input listeners, for input events targeted to this entity or its child entities.

Parameters
executor: Executor

The executor to run the listener on.

listener: JxrPlatformAdapter.InputEventListener

The input event listener to add.

dispose

Added in 1.0.0-alpha02
fun dispose(): Unit

Dispose any system resources held by this entity, and transitively calls dispose() on all the children. Once disposed, Entity shouldn't be used again.

getActivitySpaceAlpha

Added in 1.0.0-alpha02
fun getActivitySpaceAlpha(): Float

Returns the total alpha transparency level for this Entity.

getAlpha

Added in 1.0.0-alpha02
fun getAlpha(): Float

Returns the set alpha transparency level for this Entity.

getChildren

Added in 1.0.0-alpha02
fun getChildren(): (Mutable)List<JxrPlatformAdapter.Entity!>

Returns the all child entities of this Entity.

getParent

Added in 1.0.0-alpha02
fun getParent(): JxrPlatformAdapter.Entity?

Returns the parent entity for this Entity.

getPose

Added in 1.0.0-alpha02
fun getPose(): Pose

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

getScale

Added in 1.0.0-alpha02
fun getScale(): Vector3

Returns the scale of this entity, relative to its parent. Note that this doesn't include the parent's scale.

Returns
Vector3

Current [Vector3] scale applied to self and children.

isHidden

Added in 1.0.0-alpha02
fun isHidden(includeParents: Boolean): Boolean

Returns the hidden status of this Entity.

Parameters
includeParents: Boolean

Whether to include the hidden status of parents in the returned value.

Returns
Boolean

If includeParents is true, the returned value will be true if this Entity or any of its ancestors is hidden. If includeParents is false, the local hidden state is returned. Regardless of the local hidden state, an entity will not be rendered if any of its ancestors are hidden.

removeAllComponents

Added in 1.0.0-alpha02
fun removeAllComponents(): Unit

Remove all components from this entity.

removeComponent

Added in 1.0.0-alpha02
fun removeComponent(component: JxrPlatformAdapter.Component): Unit

Remove the given component from the entity.

Parameters
component: JxrPlatformAdapter.Component

Component to remove from the entity.

removeInputEventListener

Added in 1.0.0-alpha02
fun removeInputEventListener(
    listener: JxrPlatformAdapter.InputEventListener
): Unit

Removes the given listener from the set of active input listeners.

setAlpha

Added in 1.0.0-alpha02
fun setAlpha(alpha: Float): Unit

Sets the alpha transparency for the given Entity.

Parameters
alpha: Float

Alpha transparency level for the Entity.

setContentDescription

Added in 1.0.0-alpha02
fun setContentDescription(text: String): Unit

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

setHidden

Added in 1.0.0-alpha02
fun setHidden(hidden: Boolean): Unit

Sets the local hidden state of this Entity. When true, this Entity and all descendants will not be rendered in the scene. When the hidden state is false, an entity will be rendered if its ancestors are not hidden.

Parameters
hidden: Boolean

The new local hidden state of this Entity.

setParent

Added in 1.0.0-alpha02
fun setParent(parent: JxrPlatformAdapter.Entity?): Unit

Sets the parent Entity for this Entity. The child Entity's pose will be relative to the pose of its parent.

Parameters
parent: JxrPlatformAdapter.Entity?

The parent entity.

setPose

Added in 1.0.0-alpha02
fun setPose(pose: Pose): Unit

Updates the pose (position and rotation) of the Entity relative to its parent.

setScale

Added in 1.0.0-alpha02
fun setScale(scale: Vector3): Unit

Sets the scale of this entity relative to its parent. This value will affect the rendering of this Entity's children. As the scale increases, this will stretch the content of the Entity.

Parameters
scale: Vector3

The [Vector3] scale factor from the parent.

setSize

Added in 1.0.0-alpha02
fun setSize(dimensions: JxrPlatformAdapter.Dimensions): Unit

Sets the size for the given Entity.

Parameters
dimensions: JxrPlatformAdapter.Dimensions

Dimensions for the Entity in meters.