// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using Microsoft.MixedReality.Toolkit.SpatialAwareness; using System.Collections.Generic; using UnityEngine; namespace Microsoft.MixedReality.Toolkit.Experimental.SpatialAwareness { /// /// Object encapsulating the components of a spatial awareness scene object. /// public class SpatialAwarenessSceneObject : BaseSpatialAwarenessObject { /// /// Constructor. /// private SpatialAwarenessSceneObject() : base() { } /// /// Creates a . /// /// /// A SpatialAwarenessSceneObject containing the fields that describe the scene object. /// public static SpatialAwarenessSceneObject Create( int id, SpatialAwarenessSurfaceTypes surfaceType, Vector3 position, Quaternion rotation, List quads, List meshData ) { SpatialAwarenessSceneObject newObject = new SpatialAwarenessSceneObject { Id = id }; newObject.SurfaceType = surfaceType; newObject.Position = position; newObject.Rotation = rotation; newObject.Quads = quads; newObject.Meshes = meshData; return newObject; } /// /// The world position for the scene object. /// public Vector3 Position { get; private set; } /// /// The world rotation for the scene object. /// public Quaternion Rotation { get; private set; } /// /// The list of quads associated with the scene object. /// public List Quads { get; private set; } /// /// The list of meshes associated with the scene object. /// public List Meshes { get; private set; } /// /// The surface type of the scene object. /// public SpatialAwarenessSurfaceTypes SurfaceType { get; private set; } /// /// Object encapsulating data of a mesh. /// public class MeshData { /// /// Id of the mesh. /// public int Id { get; set; } /// /// Indices of the mesh. /// public int[] Indices { get; set; } /// /// Vertices of the mesh. /// public Vector3[] Vertices { get; set; } /// /// UVs of the mesh. /// public Vector2[] UVs { get; set; } /// /// The gameObject associated with the mesh. /// public GameObject GameObject { get; set; } } /// /// Object encapsulating data of a quad. /// public class QuadData { /// /// Id of the quad. /// public int Id { get; set; } /// /// Extents of the quad. /// public Vector2 Extents { get; set; } /// /// The occlusion mask of the quad. /// public byte[] OcclusionMask { get; set; } /// /// The gameObject associated with the quad. /// public GameObject GameObject { get; set; } } } }