共用方式為


Class RenderingConnection

Main entry point for Remote Rendering specific actions. Can be accessed via RenderingSession.Connection, after a successful connection.

class Microsoft::Azure::RemoteRendering::RenderingConnection final

Methods

CreateComponent

Creates a new component.

A Result.AlreadyExists error occurs, if the entity already has a component of the requested type.

auto CreateComponent(Microsoft::Azure::RemoteRendering::ObjectType componentType, ApiHandle<Microsoft::Azure::RemoteRendering::Entity> const& owner) noexcept -> Expected<ApiHandle<Microsoft::Azure::RemoteRendering::ComponentBase>, Microsoft::Azure::RemoteRendering::Status>;

Parameters

Name Type Description
componentType ObjectType Component type to create.
owner Entity Owner entity for the component.

Returns

Type Description
ComponentBase Returns null if the client has been disconnected or the owner entity already has a component of this type.

See also

CreateEntity

Creates a new entity.

auto CreateEntity() noexcept -> Expected<ApiHandle<Microsoft::Azure::RemoteRendering::Entity>, Microsoft::Azure::RemoteRendering::Status>;

Returns

Type Description
Entity Returns null if the client has been disconnected.

See also

CreateMaterial

Creates a new Material.

auto CreateMaterial(Microsoft::Azure::RemoteRendering::MaterialType type) noexcept -> Expected<ApiHandle<Microsoft::Azure::RemoteRendering::Material>, Microsoft::Azure::RemoteRendering::Status>;

Parameters

Name Type Description
type MaterialType Material type to create.

Returns

Type Description
Material Returns null if the client has been disconnected.

See also

LoadModelAsync

Initiates the loading of a model which is located in Azure storage.

This call returns immediately and initiates an asynchronous task that returns when loading the model is complete.

auto LoadModelAsync(Microsoft::Azure::RemoteRendering::LoadModelOptions options, std::function<void(Status, ApiHandle<Microsoft::Azure::RemoteRendering::LoadModelResult>)> callback) -> void;

Parameters

Name Type Description
options LoadModelOptions Parameters for loading the model.

Returns

Type Description
void Task with result LoadModelResult. The task will complete during an RenderingConnection.Update tick.

See also

LoadModelFromSasAsync

Initiates the loading of a model using a SAS token to identify the model.

This call returns immediately and initiates an asynchronous task that returns when loading the model is complete.

auto LoadModelFromSasAsync(Microsoft::Azure::RemoteRendering::LoadModelFromSasOptions options, std::function<void(Status, ApiHandle<Microsoft::Azure::RemoteRendering::LoadModelResult>)> callback) -> void;

Parameters

Name Type Description
options LoadModelFromSasOptions Parameters for loading the model.

Returns

Type Description
void Task with result LoadModelResult. The task will complete during an RenderingConnection.Update tick.

See also

LoadTextureAsync

Initiates the loading of a texture which is located in Azure storage.

This call returns immediately and initiates an asynchronous task that returns when loading the texture is complete.

auto LoadTextureAsync(Microsoft::Azure::RemoteRendering::LoadTextureOptions options, std::function<void(Status, ApiHandle<Microsoft::Azure::RemoteRendering::Texture>)> callback) -> void;

Parameters

Name Type Description
options LoadTextureOptions Parameters for loading the texture.

Returns

Type Description
void Task with result type Texture. The task will complete during an RenderingConnection.Update tick.

See also

LoadTextureFromSasAsync

Initiates the loading of a texture using a SAS token to identify the texture.

This call returns immediately and initiates an asynchronous task that returns when loading the texture is complete.

auto LoadTextureFromSasAsync(Microsoft::Azure::RemoteRendering::LoadTextureFromSasOptions options, std::function<void(Status, ApiHandle<Microsoft::Azure::RemoteRendering::Texture>)> callback) -> void;

Parameters

Name Type Description
options LoadTextureFromSasOptions Parameters for loading the texture.

Returns

Type Description
void Task with result type Texture. The task will complete during an RenderingConnection.Update tick.

See also

QueryServerPerformanceAssessmentAsync

Performs a performance assessment query on the server.

This call returns immediately and emits an event when the query result has arrived.

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

Parameters

Name Type Description
  • callback - Task with return type PerformanceAssessment which holds assessment data. The async will complete during an RenderingConnection.Update tick.

Returns

Type Description
void Task with return type PerformanceAssessment which holds assessment data. The async will complete during an RenderingConnection.Update tick.

See also

RayCastQueryAsync

Performs a raycast query on the remote scene.

This call returns immediately and emits an event when the raycast result has arrived. The raycast will be performed on the server against the state of the world on the frame that the raycast was issued on. Results will be sorted by distance, with the closest intersection to the user being the first item in the array.

auto RayCastQueryAsync(Microsoft::Azure::RemoteRendering::RayCast cast, std::function<void(Status, ApiHandle<Microsoft::Azure::RemoteRendering::RayCastQueryResult>)> callback) -> void;

Parameters

Name Type Description
cast RayCast Raycast description.
  • callback - Task with return type RayCastQueryResult which holds the array of hit elements. The async will complete during an RenderingConnection.Update tick.

Returns

Type Description
void Task with return type RayCastQueryResult which holds the array of hit elements. The async will complete during an RenderingConnection.Update tick.

See also

SpatialQueryAabbAsync

Performs a spatial query on the remote scene using an axis-aligned bounding box (AABB) as the query volume.

This is a fast way to gather all mesh parts that overlap with given bounds. The individual check is performed based on each mesh part's bounds in the scene, not on individual triangles. All the information to perform this query locally are available on the client, but for scenes with large number of parts this would be impractical. This call returns immediately and emits an event when the spatial query result has arrived. The query will be performed on the server against the state of the world on the frame that the query was issued on. The result list is not sorted. Also, when the maximum number of results is exceeded, this query returns the first n results.

auto SpatialQueryAabbAsync(Microsoft::Azure::RemoteRendering::SpatialQueryAabb query, std::function<void(Status, ApiHandle<Microsoft::Azure::RemoteRendering::SpatialQueryResult>)> callback) -> void;

Parameters

Name Type Description
query SpatialQueryAabb The query input parameters.
  • callback - Task with return type SpatialQueryResult, which holds the array of overlapping mesh components. The async will complete during an RenderingConnection.Update tick.

Returns

Type Description
void Task with return type SpatialQueryResult, which holds the array of overlapping mesh components. The async will complete during an RenderingConnection.Update tick.

See also

SpatialQueryAsync

Performs a spatial query on the remote scene.

This is a fast way to gather all mesh parts that overlap with given bounds. The individual check is performed based on each mesh part's bounds in the scene, not on individual triangles. All the information to perform this query locally are available on the client, but for scenes with large number of parts this would be impractical. This call returns immediately and emits an event when the spatial query result has arrived. The query will be performed on the server against the state of the world on the frame that the query was issued on. The result list is not sorted. Also, when the maximum number of results is exceeded, this query returns the first n results.

auto SpatialQueryAsync(Microsoft::Azure::RemoteRendering::SpatialQuery query, std::function<void(Status, ApiHandle<Microsoft::Azure::RemoteRendering::SpatialQueryResult>)> callback) -> void;

Parameters

Name Type Description
query SpatialQuery The query input parameters.
  • callback - Task with return type SpatialQueryResult, which holds the array of overlapping mesh components. The async will complete during an RenderingConnection.Update tick.

Returns

Type Description
void Task with return type SpatialQueryResult, which holds the array of overlapping mesh components. The async will complete during an RenderingConnection.Update tick.

See also

SpatialQueryObbAsync

Performs a spatial query on the remote scene using an oriented box as the query volume.

This is a fast way to gather all mesh parts that overlap with given bounds. The individual check is performed based on each mesh part's bounds in the scene, not on individual triangles. All the information to perform this query locally are available on the client, but for scenes with large number of parts this would be impractical. This call returns immediately and emits an event when the spatial query result has arrived. The query will be performed on the server against the state of the world on the frame that the query was issued on. The result list is not sorted. Also, when the maximum number of results is exceeded, this query returns the first n results.

auto SpatialQueryObbAsync(Microsoft::Azure::RemoteRendering::SpatialQueryObb query, std::function<void(Status, ApiHandle<Microsoft::Azure::RemoteRendering::SpatialQueryResult>)> callback) -> void;

Parameters

Name Type Description
query SpatialQueryObb The query input parameters.
  • callback - Task with return type SpatialQueryResult, which holds the array of overlapping mesh components. The async will complete during an RenderingConnection.Update tick.

Returns

Type Description
void Task with return type SpatialQueryResult, which holds the array of overlapping mesh components. The async will complete during an RenderingConnection.Update tick.

See also

SpatialQuerySphereAsync

Performs a spatial query on the remote scene using a sphere as the query volume.

This is a fast way to gather all mesh parts that overlap with given bounds. The individual check is performed based on each mesh part's bounds in the scene, not on individual triangles. All the information to perform this query locally are available on the client, but for scenes with large number of parts this would be impractical. This call returns immediately and emits an event when the spatial query result has arrived. The query will be performed on the server against the state of the world on the frame that the query was issued on. The result list is not sorted. Also, when the maximum number of results is exceeded, this query returns the first n results.

auto SpatialQuerySphereAsync(Microsoft::Azure::RemoteRendering::SpatialQuerySphere query, std::function<void(Status, ApiHandle<Microsoft::Azure::RemoteRendering::SpatialQueryResult>)> callback) -> void;

Parameters

Name Type Description
query SpatialQuerySphere The query input parameters.
  • callback - Task with return type SpatialQueryResult, which holds the array of overlapping mesh components. The async will complete during an RenderingConnection.Update tick.

Returns

Type Description
void Task with return type SpatialQueryResult, which holds the array of overlapping mesh components. The async will complete during an RenderingConnection.Update tick.

See also

Update

Pushes all client updates to the server and dispatches all messages received from the server.

Client updates such as entity and component state changes, raycast requests, and other async operations are queued on the client side and only sent to the server during a call to Update().

Similarly, results from the server that arrived in the mean time, for example for raycasts and model loads, have been queued and will be dispatched to the client code only during Update().

Consequently, Update() must be called once every frame. Calls to Update() invoke the RenderingConnection.Updated event.

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

Properties

CameraSettings

Global camera settings.

auto GetCameraSettings() const noexcept -> ApiHandle<Microsoft::Azure::RemoteRendering::CameraSettings>;

See also

DebugRenderingSettings

Global debug rendering settings.

auto GetDebugRenderingSettings() const noexcept -> ApiHandle<Microsoft::Azure::RemoteRendering::DebugRenderingSettings>;

See also

LogLevel

Only messages at this log level or below will be delivered through RenderingConnection.MessageLogged.

auto GetLogLevel() const noexcept -> Microsoft::Azure::RemoteRendering::LogLevel;
auto SetLogLevel(Microsoft::Azure::RemoteRendering::LogLevel value) noexcept -> Microsoft::Azure::RemoteRendering::Status;

OutlineSettings

Global outline settings.

auto GetOutlineSettings() const noexcept -> ApiHandle<Microsoft::Azure::RemoteRendering::OutlineSettings>;

See also

PointCloudSettings_Experimental

Experimental: Access the global point cloud settings.

auto GetPointCloudSettingsExperimental() const noexcept -> ApiHandle<Microsoft::Azure::RemoteRendering::PointCloudSettings>;

RootEntities

Retrieves the list of all root entities. A root entity is any existing entity that has no Entity.Parent. This includes root entities created through loading a model and entities created client-side. The returned entities do not appear in a specific order in the list.

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

ShellRenderingSettings

Global shell rendering settings.

auto GetShellRenderingSettings() const noexcept -> ApiHandle<Microsoft::Azure::RemoteRendering::ShellRenderingSettings>;

See also

SingleSidedSettings

Global single-sided rendering settings.

auto GetSingleSidedSettings() const noexcept -> ApiHandle<Microsoft::Azure::RemoteRendering::SingleSidedSettings>;

See also

SkyReflectionSettings

Global sky reflection settings.

auto GetSkyReflectionSettings() const noexcept -> ApiHandle<Microsoft::Azure::RemoteRendering::SkyReflectionSettings>;

See also

StageSpaceSettings

Global stage space settings.

auto GetStageSpaceSettings() const noexcept -> ApiHandle<Microsoft::Azure::RemoteRendering::StageSpaceSettings>;

See also

ZFightingMitigationSettings

Global z-fighting mitigation state.

auto GetZFightingMitigationSettings() const noexcept -> ApiHandle<Microsoft::Azure::RemoteRendering::ZFightingMitigationSettings>;

See also

Events

MessageLogged

Log messages are delivered through this callback.

auto MessageLogged(LogEventHandler const& handler) noexcept -> Expected<event_token, Microsoft::Azure::RemoteRendering::Status>;
auto MessageLogged(event_token& token) noexcept -> Microsoft::Azure::RemoteRendering::Status;

Updated

Event that is called after RenderingConnection.Update has finished.

auto Updated(RenderingConnectionUpdatedEventHandler const& handler) noexcept -> Expected<event_token, Microsoft::Azure::RemoteRendering::Status>;
auto Updated(event_token& token) noexcept -> Microsoft::Azure::RemoteRendering::Status;

See also