Share via


Entity Class

Definition

An entity represents an object in space.

public ref class Entity : Microsoft::Azure::RemoteRendering::ObjectBase
public class Entity : Microsoft.Azure.RemoteRendering.ObjectBase
type Entity = class
    inherit ObjectBase
Public Class Entity
Inherits ObjectBase
Inheritance

Remarks

Entities have a transform, meaning a position, rotation and scale. By themselves entities don't have any observable functionality. Instead behavior is added through components (see ComponentBase), which are attached to entities. For instance attaching a MeshComponent will make a mesh appear at the position of the entity.

The most important aspect of the entity itself is the hierarchy and the resulting hierarchical transform. For example, when multiple entities are attached as children to a shared parent entity, all of these entities can be moved, rotated and scaled in unison by changing the transform of the parent entity.

Properties

Children

Read-only list of all the entities that are attached as children to this one.

Components

Read-only list of all the components that are attached to this entity.

Enabled

Enables or disables the entity and all its components and children.

GlobalTransform

Computes the transform of this entity in global space, as used for rendering.

InteropId (Inherited from ObjectBase)
LocalToGlobalMatrix

Similar to GlobalTransform but converted to a 4x4 matrix.

LocalTransform

Get or set the local transform of this entity. The same can be achieved through getting/setting Position, Rotation, and Scale individually.

Name

Optional name property.

Parent

The entity that acts as this entity's parent.

Position

Position, relative to the parent node.

Root

The topmost parent entity in this hierarchy. If this entity is a root entity itself (i.e. Parent is invalid) then this returns this entity.

Rotation

Rotation, relative to the parent node.

Scale

Scale, relative to the parent node.

Static

Indicates whether this object originates from a model conversion that used the 'SceneGraphMode=static' parameter for conversion. These objects cannot be transformed individually or re-parented. Calling transform or re-parenting on a static object will return the 'ObjectStatic' error code.

Type

The exact type of this object.

Valid

Whether this entity is still valid.

Methods

AsToolingObject<ToolingObject>() (Inherited from ObjectBase)
Destroy()

Destroys the entity.

Equals(Object) (Inherited from ObjectBase)
FindByPath(String, StringComparison, String, Int32)

Returns a list of entities that are under this entity and that match the exact search path. A path is a sequence of entity names, separated by a special path delimiter character/string. For instance, a path string could be "house/table/leg4". In that example, this function would search for direct child entities named "house", from there recursively search for child entities named "table" and so on. It only returns those entities that match the full path.

FindComponentOfType(ObjectType)

Tries to find a component of the given type that is attached to this entity.

FindComponentOfType<T>()

Find a component of a type on this Entity.

FindComponentsOfTypeInHierarchy(ObjectType, Int32)

Traverses the entity's sub graph (including this entity) and returns a list of all components of certain type found in the graph.

FindEntitiesByNameInHierarchy(String, StringComparison, Int32)

Traverses the entity's sub graph (including this entity) and returns a list of entities that have a matching name.

FindFirstEntity(Entity+EntitySearchDelegate)

Find first entity in this entity's hierarchy (inclusive of itself) that fulfills pred. Search is performed in a depth first order.

GetChildren(List<Entity>)
GetComponents(List<ComponentBase>)
GetHashCode() (Inherited from ObjectBase)
GetRootPath(String)

Returns the path string to this entity, starting at the root entity. A path is a sequence of entity names, separated by a special path delimiter character/string. A possible path may look like this: "root/house/table/leg4".

QueryLocalBoundsAsync()

Queries the local-space bounding box from the server.

QueryMetadataAsync()

Queries for any available metadata on a single entity.

QueryWorldBoundsAsync()

Queries the world-space bounding box from the server.

TryFindByPath(String, StringComparison, String, Int32, List<Entity>)
TryFindComponentsOfTypeInHierarchy(ObjectType, Int32, List<ComponentBase>)
TryFindEntitiesByNameInHierarchy(String, StringComparison, Int32, List<Entity>)
VisitEntity(Entity+VisitEntityDelegate)

Visit this entity and any children in a depth first traversal until every node is visited or until the visitor returns VisitorResult.ExitVisit

Applies to

See also