JxrPlatformAdapter.Entity


public interface JxrPlatformAdapter.Entity extends 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 methods

abstract void

Add given Entity as child.

abstract void
abstract boolean

Add these components to entity.

abstract void

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

abstract void

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

abstract float

Returns the total alpha transparency level for this Entity.

abstract float

Returns the set alpha transparency level for this Entity.

abstract @NonNull List<JxrPlatformAdapter.Entity>
abstract @Nullable JxrPlatformAdapter.Entity
abstract @NonNull Pose

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

abstract @NonNull Vector3

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

abstract boolean
isHidden(boolean includeParents)

Returns the hidden status of this Entity.

abstract void

Remove all components from this entity.

abstract void

Remove the given component from the entity.

abstract void

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

abstract void
setAlpha(float alpha)

Sets the alpha transparency for the given Entity.

abstract void
abstract void
setHidden(boolean hidden)

Sets the local hidden state of this Entity.

abstract void
abstract void

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

abstract void

Sets the scale of this entity relative to its parent.

abstract void

Sets the size for the given Entity.

Inherited methods

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

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

abstract @NonNull Vector3

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

abstract @NonNull Vector3

Returns the scale of this ActivityPose.

abstract @NonNull Pose

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

Public methods

addChild

Added in 1.0.0-alpha01
abstract void addChild(@NonNull JxrPlatformAdapter.Entity child)

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

Parameters
@NonNull JxrPlatformAdapter.Entity child

The child entity.

addChildren

Added in 1.0.0-alpha01
abstract void addChildren(@NonNull List<JxrPlatformAdapter.Entity> children)

addComponent

Added in 1.0.0-alpha01
abstract boolean addComponent(@NonNull JxrPlatformAdapter.Component component)

Add these components to entity.

Parameters
@NonNull JxrPlatformAdapter.Component 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-alpha01
abstract void addInputEventListener(
    @NonNull Executor executor,
    @NonNull JxrPlatformAdapter.InputEventListener listener
)

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

Parameters
@NonNull Executor executor

The executor to run the listener on.

@NonNull JxrPlatformAdapter.InputEventListener listener

The input event listener to add.

dispose

Added in 1.0.0-alpha01
abstract void dispose()

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-alpha01
abstract float getActivitySpaceAlpha()

Returns the total alpha transparency level for this Entity.

getAlpha

Added in 1.0.0-alpha01
abstract float getAlpha()

Returns the set alpha transparency level for this Entity.

getChildren

Added in 1.0.0-alpha01
abstract @NonNull List<JxrPlatformAdapter.EntitygetChildren()

getParent

Added in 1.0.0-alpha01
abstract @Nullable JxrPlatformAdapter.Entity getParent()

getPose

Added in 1.0.0-alpha01
abstract @NonNull Pose getPose()

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

getScale

Added in 1.0.0-alpha01
abstract @NonNull Vector3 getScale()

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

Returns
@NonNull Vector3

Current [Vector3] scale applied to self and children.

isHidden

Added in 1.0.0-alpha01
abstract boolean isHidden(boolean includeParents)

Returns the hidden status of this Entity.

Parameters
boolean includeParents

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-alpha01
abstract void removeAllComponents()

Remove all components from this entity.

removeComponent

Added in 1.0.0-alpha01
abstract void removeComponent(@NonNull JxrPlatformAdapter.Component component)

Remove the given component from the entity.

Parameters
@NonNull JxrPlatformAdapter.Component component

Component to remove from the entity.

removeInputEventListener

Added in 1.0.0-alpha01
abstract void removeInputEventListener(
    @NonNull JxrPlatformAdapter.InputEventListener listener
)

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

setAlpha

Added in 1.0.0-alpha01
abstract void setAlpha(float alpha)

Sets the alpha transparency for the given Entity.

Parameters
float alpha

Alpha transparency level for the Entity.

setContentDescription

Added in 1.0.0-alpha01
abstract void setContentDescription(@NonNull String text)

setHidden

Added in 1.0.0-alpha01
abstract void setHidden(boolean hidden)

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
boolean hidden

The new local hidden state of this Entity.

setParent

Added in 1.0.0-alpha01
abstract void setParent(@Nullable JxrPlatformAdapter.Entity parent)

setPose

Added in 1.0.0-alpha01
abstract void setPose(@NonNull Pose pose)

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

setScale

Added in 1.0.0-alpha01
abstract void setScale(@NonNull Vector3 scale)

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
@NonNull Vector3 scale

The [Vector3] scale factor from the parent.

setSize

Added in 1.0.0-alpha01
abstract void setSize(@NonNull JxrPlatformAdapter.Dimensions dimensions)

Sets the size for the given Entity.

Parameters
@NonNull JxrPlatformAdapter.Dimensions dimensions

Dimensions for the Entity in meters.