using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Ximmerse.XR.Tag { public enum GroundPlaneMode : byte { ground = 0, wall, } [System.Serializable] public class GroundPlaneLayout { /// /// Ground plane items. /// public GroundPlaneGroup[] groundPlaneGroups; public bool IsValid() { return groundPlaneGroups != null && groundPlaneGroups.Length > 0; } } /// /// Ground Plane groups, contains many ground plane items. /// [System.Serializable] public class GroundPlaneGroup { public int groupIndex; /// /// 组下的每个 ground plane item /// public GroundPlaneLayoutItem[] groundPlanes; } [System.Serializable] public class SingleGroundPlaneTechnicalParameter { /// /// drift recenter angle threshold /// public float drift_recenter_angle_threshold = 1.0f; /// /// drift recenter distance threshold /// public float drift_recenter_distance_threshold = 1.0f; /// /// confidence threshold /// public float confidence_thresh = 0.9f; /// /// min distance threshold /// public float max_distance_thresh = 1.8f; /// /// max distance threshold /// public float min_distance_thresh = 0.1f; } /// /// Single ground plane item data. /// [System.Serializable] public class GroundPlaneLayoutItem { public int track_id; public GroundPlaneMode mode; public Vector3 position; public Vector3 euler; public SingleGroundPlaneTechnicalParameter technicalParameter = new SingleGroundPlaneTechnicalParameter(); } /// /// 用于 Fusoin模式下,Ground Plane 的矩阵配置 /// [CreateAssetMenu(menuName = "Ximmerse/Ground Plane Layout Config", fileName = "Ground Plane Layout Config")] public sealed class GroundPlaneLayoutConfiguration : ScriptableObject { /// /// The ground plane matrix. /// public GroundPlaneLayout layout = new GroundPlaneLayout() { groundPlaneGroups = new GroundPlaneGroup[] { new GroundPlaneGroup() { groupIndex = 0, groundPlanes = new GroundPlaneLayoutItem[] { } } } }; [ContextMenu ("Test : load this config")] void TestLoadMe() { SDKVariants.groundPlaneLayout = layout; XimmerseXR.LoadGroundPlaneLayout(this.layout); } } }