This repository has been archived by the owner on May 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added initial files for spatial awareness * Implemented LuminSpatialObserver * blocked out platform support * removed a few more base profile references
- Loading branch information
1 parent
a196ab9
commit 87b61fa
Showing
11 changed files
with
417 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Copyright (c) XRTK. All rights reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
using UnityEditor; | ||
using XRTK.Inspectors.Profiles.SpatialAwareness; | ||
using XRTK.Lumin.Profiles; | ||
|
||
namespace XRTK.Lumin.Inspectors | ||
{ | ||
[CustomEditor(typeof(LuminSpatialMeshObserverProfile))] | ||
public class LuminSpatialMeshObserverProfileInspector : BaseMixedRealitySpatialMeshObserverProfileInspector | ||
{ | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Inspectors/LuminSpatialMeshObserverProfileInspector.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Copyright (c) XRTK. All rights reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
#if PLATFORM_LUMIN | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
using UnityEngine; | ||
using UnityEngine.Experimental.XR; | ||
using UnityEngine.XR.MagicLeap; | ||
|
||
namespace XRTK.Lumin | ||
{ | ||
/// <summary> | ||
/// Shamelessly lifted from the UnityEngine.XR.MagicLeap packages, but Unity had to make their class internal. Boo. | ||
/// </summary> | ||
internal static class LuminApi | ||
{ | ||
private const string UNITY_MAGIC_LEAP_DLL = "UnityMagicLeap"; | ||
|
||
[DllImport(UNITY_MAGIC_LEAP_DLL)] | ||
public static extern void UnityMagicLeap_MeshingUpdateSettings(MeshingSettings newSettings); | ||
|
||
[DllImport(UNITY_MAGIC_LEAP_DLL)] | ||
public static extern void UnityMagicLeap_MeshingSetLod(MLSpatialMapper.LevelOfDetail lod); | ||
|
||
[DllImport(UNITY_MAGIC_LEAP_DLL)] | ||
public static extern void UnityMagicLeap_MeshingSetBounds(Vector3 center, Quaternion rotation, Vector3 extents); | ||
|
||
[DllImport(UNITY_MAGIC_LEAP_DLL)] | ||
public static extern void UnityMagicLeap_MeshingSetBatchSize(int batchSize); | ||
|
||
[DllImport(UNITY_MAGIC_LEAP_DLL)] | ||
public static extern IntPtr UnityMagicLeap_MeshingAcquireConfidence(TrackableId meshId, out int count); | ||
|
||
[DllImport(UNITY_MAGIC_LEAP_DLL)] | ||
public static extern void UnityMagicLeap_MeshingReleaseConfidence(TrackableId meshId); | ||
|
||
[Flags] | ||
public enum MeshingFlags | ||
{ | ||
None = 0, | ||
PointCloud = 1, | ||
ComputeNormals = 2, | ||
ComputeConfidence = 4, | ||
Planarize = 8, | ||
RemoveMeshSkirt = 16, // 0x00000010 | ||
IndexOrderCCW = 32, // 0x00000020 | ||
} | ||
|
||
[StructLayout(LayoutKind.Sequential)] | ||
public struct MeshingSettings | ||
{ | ||
public MeshingFlags flags; | ||
public float fillHoleLength; | ||
public float disconnectedComponentArea; | ||
} | ||
} | ||
} | ||
|
||
#endif // PLATFORM_LUMIN |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright (c) XRTK. All rights reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
using UnityEngine; | ||
using XRTK.Definitions.Utilities; | ||
using XRTK.Providers.SpatialObservers; | ||
|
||
namespace XRTK.Lumin.Profiles | ||
{ | ||
[CreateAssetMenu(menuName = "Mixed Reality Toolkit/Spatial Observers/Lumin Spatial Mesh Data Provider Profile", fileName = "LuminMeshObserverProfile", order = (int)CreateProfileMenuItemIndices.SpatialAwarenessDataProviders)] | ||
public class LuminSpatialMeshObserverProfile : BaseMixedRealitySpatialMeshObserverProfile { } | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.