Class Entity

An entity represents an object in space.

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.

class Microsoft::Azure::RemoteRendering::Entity final : public Microsoft::Azure::RemoteRendering::ObjectBase

Methods

Destroy

Destroys the entity.

Destroying an entity will also destroy all of its components and child entities. Once Destroy() has been called, Entity.Valid returns false.

auto Destroy() noexcept -> Microsoft::Azure::RemoteRendering::Status;

See also

FindComponentOfType

Tries to find a component of the given type.

Only one instance of each component type can be attached to each entity. Therefore this function either returns a single result, or null, if none is found.

auto FindComponentOfType(Microsoft::Azure::RemoteRendering::ObjectType type) noexcept -> Expected<ApiHandle<Microsoft::Azure::RemoteRendering::ComponentBase>, Microsoft::Azure::RemoteRendering::Status>;

Parameters

Name Type Description
type ObjectType Component type to search for.

Returns

Type Description
ComponentBase

QueryLocalBoundsAsync

Queries the local-space bounding box from the server.

QueryLocalBoundsAsync is an asynchronous call. The computation of the bounds is performed on the server and returned when available.

auto QueryLocalBoundsAsync(std::function<void(Status, Microsoft::Azure::RemoteRendering::Bounds)> callback) -> void;

Parameters

Name Type Description
  • callback

Returns

Type Description
void

QueryMetadataAsync

Queries for any available metadata on a single entity.

auto QueryMetadataAsync(std::function<void(Status, ApiHandle<Microsoft::Azure::RemoteRendering::ObjectMetadata>)> callback) -> void;

Parameters

Name Type Description
  • callback

Returns

Type Description
void

QueryWorldBoundsAsync

Queries the world-space bounding box from the server.

The bounding box represents the volume that this entity, all its child entities, and attached meshes take up.

QueryWorldBoundsAsync is an asynchronous call. The computation of the bounds is performed on the server and returned when available.

auto QueryWorldBoundsAsync(std::function<void(Status, Microsoft::Azure::RemoteRendering::Bounds)> callback) -> void;

Parameters

Name Type Description
  • callback

Returns

Type Description
void

See also

Properties

Children

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

To make an entity the child of another entity, use the Entity.Parent property.

auto GetChildren(std::vector<ApiHandle<Microsoft::Azure::RemoteRendering::Entity>> & out) const noexcept -> void;

Components

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

auto GetComponents(std::vector<ApiHandle<Microsoft::Azure::RemoteRendering::ComponentBase>> & out) const noexcept -> void;

Enabled

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

Disabling an entity is similar to deleting it, except that it can be enabled again easily. All components on a disabled entity are disabled as well, and so are all child entities.

auto GetEnabled() const noexcept -> bool;
auto SetEnabled(bool value) noexcept -> Microsoft::Azure::RemoteRendering::Status;

Name

Optional name property.

A Result.StringTooLong error occurs if the given string is excessively long.

auto GetName(std::string & out) const noexcept -> void;
auto SetName(std::string const& value) noexcept -> Microsoft::Azure::RemoteRendering::Status;

Parent

The entity that acts as this entity's parent.

Top level entities don't have a parent, in which case this returns null. Setting a new parent automatically adds this entity to the list of children of the provided parent.

auto GetParent() const noexcept -> ApiHandle<Microsoft::Azure::RemoteRendering::Entity>;
auto SetParent(ApiHandle<Microsoft::Azure::RemoteRendering::Entity> const& value) noexcept -> Microsoft::Azure::RemoteRendering::Status;

Position

Position, relative to the parent node.

A Result.InvalidParam error occurs if the given value is NaN or infinite.

auto GetPosition() const noexcept -> Microsoft::Azure::RemoteRendering::Double3;
auto SetPosition(Microsoft::Azure::RemoteRendering::Double3 const& value) noexcept -> Microsoft::Azure::RemoteRendering::Status;

Rotation

Rotation, relative to the parent node.

A Result.InvalidParam error occurs if the given value is NaN or infinite.

auto GetRotation() const noexcept -> Microsoft::Azure::RemoteRendering::Quaternion;
auto SetRotation(Microsoft::Azure::RemoteRendering::Quaternion const& value) noexcept -> Microsoft::Azure::RemoteRendering::Status;

Scale

Scale, relative to the parent node.

A Result.InvalidParam error occurs if the given value is NaN or infinite.

auto GetScale() const noexcept -> Microsoft::Azure::RemoteRendering::Float3;
auto SetScale(Microsoft::Azure::RemoteRendering::Float3 const& value) noexcept -> Microsoft::Azure::RemoteRendering::Status;

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.

auto GetStatic() const noexcept -> bool;

Type

The exact type of this object.

auto GetType() const noexcept -> Microsoft::Azure::RemoteRendering::ObjectType;

Valid

Whether this entity is still valid.

An entity is invalid if it has been destroyed or if the connection has been lost. It is an error to call any other function on an invalid object.

auto GetValid() const noexcept -> bool;

See also