public class FakeEntity extends FakeActivityPose

Known direct subclasses
FakeGltfEntity

Test-only implementation of GltfEntity

FakePanelEntity

Test-only implementation of PanelEntity

FakeSubspaceNodeEntity
FakeSurfaceEntity

Test-only implementation of SurfaceEntity

FakeSystemSpaceEntity

Test-only implementation of SystemSpaceEntity

Known indirect subclasses
FakeActivityPanelEntity

Test-only implementation of ActivityPanelEntity

FakeActivitySpace

Test-only implementation of ActivitySpace

FakeAnchorEntity

Test-only implementation of AnchorEntity


Test-only implementation of Entity

Summary

Public constructors

Public methods

void

Add given Entity as child.

void

Sets the provided Entities to be children of the Entity.

boolean

Add given component to entity.

void
addInputEventListener(
    @NonNull Executor executor,
    @NonNull InputEventListener listener
)

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

void

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

float
getAlpha(int relativeTo)

Returns the effective alpha transparency level of the entity, relative to the given space.

@NonNull List<@NonNull Entity>

Sets the provided Entities to be children of the Entity.

@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 String

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

Entity

Sets the parent Entity for this Entity.

@NonNull Pose
getPose(int relativeTo)

Returns the pose for this entity, relative to the given space.

@NonNull Vector3
getScale(int relativeTo)

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

boolean
isHidden(boolean includeParents)

Returns the hidden status of this Entity.

void

Remove all components from this entity.

void

Remove the given component from the entity.

void

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

void
setAlpha(float alpha, int relativeTo)

Sets the alpha transparency for the given Entity, relative to the given space.

void
setContentDescription(@NonNull String contentDescription)

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

void
setHidden(boolean hidden)

Sets the local hidden state of this Entity.

void
setParent(Entity parent)

Sets the parent Entity for this Entity.

void
setPose(@NonNull Pose pose, int relativeTo)

Updates the pose (position and rotation) of the Entity relative to the given space.

void
setScale(@NonNull Vector3 scale, int relativeTo)

Sets the scale of this entity relative to the given space.

Public constructors

FakeEntity

Added in 1.0.0-alpha04
public FakeEntity()

Public methods

addChild

Added in 1.0.0-alpha04
public void addChild(@NonNull Entity child)

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

Parameters
@NonNull Entity child

The child entity.

addChildren

public void addChildren(@NonNull List<@NonNull Entity> children)

Sets the provided Entities to be children of the Entity.

addComponent

Added in 1.0.0-alpha04
public boolean addComponent(@NonNull Component component)

Add given component to entity.

Parameters
@NonNull 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-alpha04
public void addInputEventListener(
    @NonNull Executor executor,
    @NonNull 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 InputEventListener listener

The input event listener to add.

dispose

Added in 1.0.0-alpha04
public 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.

getAlpha

Added in 1.0.0-alpha04
public float getAlpha(int relativeTo)

Returns the effective alpha transparency level of the entity, relative to the given space.

Parameters
int relativeTo

The space in which to evaluate the alpha.

getChildren

Added in 1.0.0-alpha04
public @NonNull List<@NonNull EntitygetChildren()

Sets the provided Entities to be children of the Entity.

getComponents

Added in 1.0.0-alpha04
public @NonNull List<@NonNull ComponentgetComponents()

Retrieves all components attached to this Entity.

Returns
@NonNull List<@NonNull Component>

List attached to this Entity.

getComponentsOfType

Added in 1.0.0-alpha04
public @NonNull List<@NonNull T> <T extends Component> getComponentsOfType(@NonNull Class<@NonNull T> type)

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

Parameters
@NonNull Class<@NonNull T> type

The type of Component to retrieve.

Returns
@NonNull List<@NonNull T>

List of the given type attached to this Entity.

getContentDescription

Added in 1.0.0-alpha04
public @NonNull String getContentDescription()

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

getParent

Added in 1.0.0-alpha04
public Entity getParent()

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

The parent entity.

getPose

Added in 1.0.0-alpha04
public @NonNull Pose getPose(int relativeTo)

Returns the pose for this entity, relative to the given space.

getScale

Added in 1.0.0-alpha04
public @NonNull Vector3 getScale(int relativeTo)

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

Returns
@NonNull Vector3

Current Vector3 scale relative to the given space.

isHidden

Added in 1.0.0-alpha04
public 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-alpha04
public void removeAllComponents()

Remove all components from this entity.

removeComponent

Added in 1.0.0-alpha04
public void removeComponent(@NonNull Component component)

Remove the given component from the entity.

Parameters
@NonNull Component component

Component to remove from the entity.

removeInputEventListener

Added in 1.0.0-alpha04
public void removeInputEventListener(@NonNull InputEventListener listener)

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

setAlpha

Added in 1.0.0-alpha04
public void setAlpha(float alpha, int relativeTo)

Sets the alpha transparency for the given Entity, relative to the given space.

Parameters
float alpha

Alpha transparency level for the Entity.

int relativeTo

The space in which to set the alpha.

setContentDescription

Added in 1.0.0-alpha04
public void setContentDescription(@NonNull String contentDescription)

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

setHidden

Added in 1.0.0-alpha04
public 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-alpha04
public void setParent(Entity parent)

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

Parameters
Entity parent

The parent entity.

setPose

Added in 1.0.0-alpha04
public void setPose(@NonNull Pose pose, int relativeTo)

Updates the pose (position and rotation) of the Entity relative to the given space.

setScale

Added in 1.0.0-alpha04
public void setScale(@NonNull Vector3 scale, int 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 stretch the content of the Entity.

Parameters
@NonNull Vector3 scale

The Vector3 scale factor relative to the given space.

int relativeTo

The space in which to set the scale.