public final class GroupEntity extends BaseEntity


An Entity that contains no content, but can have an arbitrary number of children. GroupEntity is useful for organizing the placement and movement of a group of child SceneCore Entities.

Summary

Public methods

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

Public factory method for creating a GroupEntity.

Inherited methods

From androidx.xr.scenecore.BaseEntity
void

Sets an Entity to be a child of this Entity in the scene graph.

boolean

Adds a Component to this Entity.

void

Disposes of any system resources held by this Entity, and transitively calls dispose() on all its children.

float
getAlpha(int relativeTo)

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

@NonNull List<@NonNull Component>

Retrieves all components attached to this Entity.

@NonNull List<@NonNull T>

Retrieves all Components of the given type T and its sub-types attached to this Entity.

@NonNull CharSequence

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

Entity

The parent of this Entity, from which this Entity will inherit most of its properties.

@NonNull Pose
getPose(int relativeTo)

Returns the Pose for this Entity, relative to the provided Space.

float
getScale(int relativeTo)

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

boolean
isEnabled(boolean includeParents)

Returns the enabled status of this Entity.

void

Remove all components from this Entity.

void

Removes the given Component from this Entity.

void
setAlpha(float alpha, int relativeTo)

Sets the alpha transparency of the Entity relative to given Space.

void

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

void
setEnabled(boolean enabled)

Sets the local enabled state of this Entity.

void
setParent(Entity parent)

The parent of this Entity, from which this Entity will inherit most of its properties.

void
setPose(@NonNull Pose pose, int relativeTo)

Sets the Pose for this Entity.

void
setScale(float scale, int relativeTo)

Sets the scale of this Entity relative to given Space.

From androidx.xr.scenecore.Entity
@FloatRange(from = 0.0, to = 1.0) float

Returns the alpha transparency set for this Entity.

@NonNull Pose

Returns the Pose for this Entity, relative to its parent.

@FloatRange(from = 0.0) float

Returns the local scale of this Entity, not inclusive of the parent's scale.

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

Sets the alpha transparency of the Entity and its children.

void

Sets the Pose for this Entity, relative to its parent.

void
setScale(@FloatRange(from = 0.0) float scale)

Sets the scale of this Entity relative to its parent.

From androidx.xr.scenecore.ScenePose
abstract @NonNull Pose

The current Pose relative to the activity space root.

abstract @NonNull HitTestResult
hitTest(@NonNull Vector3 origin, @NonNull Vector3 direction)

Creates a hit test from the specified origin in the specified direction into the Scene.

abstract @NonNull HitTestResult
hitTest(
    @NonNull Vector3 origin,
    @NonNull Vector3 direction,
    int hitTestFilter
)

Creates a hit test from the specified origin in the specified direction into the scene.

abstract @NonNull Pose
transformPoseTo(@NonNull Pose pose, @NonNull ScenePose destination)

Returns a Pose relative to this ScenePose, transformed into a Pose relative to the destination.

Public methods

create

Added in 1.0.0-alpha06
public static final @NonNull Entity create(@NonNull Session session, @NonNull String name, @NonNull Pose pose)

Public factory method for creating a GroupEntity.

Parameters
@NonNull Session session

Session to create the GroupEntity in.

@NonNull String name

Name of the entity.

@NonNull Pose pose

Initial pose of the entity.