Integrating with Data Streaming
Setting up the MetadataProvider
To set up the MedataProvider, see Setting up a IMetadataProvider.
Setting up the DataStreamer
See Getting Started with Data Streaming for more information.
Using Datastreaming to obtain an instance's metadata
One use case for the integration between the two packages, is to use Datastreaming as method of picking an instance in the scene, and then using its Id to obtain its metadata.
Using the datastreamer's raycaster
By passing a Ray to the RaycastAsync method, you get a RaycastResult. A normal use-case would be to pass the mouse position converted into a ray.
Using the RaycastResult
The RaycastResult contains a property named InstanceId. The string is empty if there is no hit with the raycast. This can be caused by:
- The raycast did actually hit nothing
- The scene is too old and doesn't contain an indexed texture.
Using the InstanceId for a metadata query
The obtained InstanceId can then be used directly into the metadata query builder's IncludedIn method. For more info on how to build metadata queries, see Querying metadata
Using Metadata to filter
The metadata package can be used to obtain a list of InstanceId that can then be provided to the DataStreamer to filter them out.