BaseEntity
public abstract class BaseEntity<RtEntityType extends Entity> extends BaseScenePose implements 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 methods |
|
|---|---|
void |
Sets an Entity to be a child of this Entity in the scene graph. |
boolean |
addComponent(@NonNull Component component)Adds a Component to this Entity. |
void |
dispose()Disposes of any system resources held by this Entity, and transitively calls dispose() on all its children. |
float |
Returns the alpha transparency set for this Entity, relative to given Space. |
@NonNull List<@NonNull Entity> |
Provides the list of all children of this entity. |
@NonNull List<@NonNull Component> |
Retrieves all components attached to this Entity. |
@NonNull List<@NonNull T> |
<T extends Component> getComponentsOfType(@NonNull Class<@NonNull T> type)Retrieves all Components of the given type |
@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 |
Returns the |
float |
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 |
removeComponent(@NonNull Component component)Removes the given Component from this Entity. |
void |
Sets the alpha transparency of the Entity relative to given Space. |
void |
setContentDescription(@NonNull CharSequence contentDescription)Alternate text for this Entity to be consumed by Accessibility systems. |
void |
setEnabled(boolean enabled)Sets the local enabled state of this Entity. |
void |
The parent of this Entity, from which this Entity will inherit most of its properties. |
void |
Sets the |
void |
Sets the scale of this Entity relative to the given Space. |
Inherited methods |
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||
|
Public methods
addChild
public void addChild(@NonNull Entity child)
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
public boolean addComponent(@NonNull Component component)
Adds a Component to this Entity.
| Returns | |
|---|---|
boolean |
True if given Component was successfully added to the Entity. |
dispose
public void dispose()
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
public float getAlpha(@NonNull Space relativeTo)
Returns the alpha transparency set for this Entity, relative to given Space.
getChildren
public @NonNull List<@NonNull Entity> getChildren()
Provides the list of all children of this entity.
getComponents
public @NonNull List<@NonNull Component> getComponents()
Retrieves all components attached to this Entity.
getComponentsOfType
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.
getContentDescription
public @NonNull CharSequence getContentDescription()
Alternate text for this Entity to be consumed by Accessibility systems.
getParent
public Entity getParent()
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.
getPose
public @NonNull Pose getPose(@NonNull Space relativeTo)
Returns the Pose for this Entity, relative to the provided Space.
getScale
public float getScale(@NonNull Space relativeTo)
Returns the scale of this entity, relative to given space.
| Parameters | |
|---|---|
@NonNull Space relativeTo |
Get the scale relative to given Space. Default value is the parent space. |
| Returns | |
|---|---|
float |
Current uniform scale applied to self and children. |
isEnabled
public boolean isEnabled(boolean includeParents)
Returns the enabled status of this Entity.
| Parameters | |
|---|---|
boolean includeParents |
Whether to include the enabled status of parents in the returned value. |
| Returns | |
|---|---|
boolean |
If includeParents is |
removeComponent
public void removeComponent(@NonNull Component component)
Removes the given Component from this Entity.
setAlpha
public void setAlpha(float alpha, @NonNull Space relativeTo)
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.
setContentDescription
public void setContentDescription(@NonNull CharSequence contentDescription)
Alternate text for this Entity to be consumed by Accessibility systems.
setEnabled
public void setEnabled(boolean enabled)
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 | |
|---|---|
boolean enabled |
The new local enabled state of this Entity. |
setParent
public void setParent(Entity parent)
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.
setPose
public void setPose(@NonNull Pose pose, @NonNull Space relativeTo)
Sets the Pose for this Entity. The Pose given is set relative to the Space provided.