This repository was 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
Dev spatial awareness #20
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
XRTK.Lumin/Packages/com.xrtk.lumin/Inspectors/LuminSpatialMeshObserverProfileInspector.cs
This file contains hidden or 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 u 10000 nder 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
...Lumin/Packages/com.xrtk.lumin/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 hidden or 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.
12 changes: 12 additions & 0 deletions
12
XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminSpatialMeshObserverProfile.cs
This file contains hidden or 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 { } | ||
} |
11 changes: 11 additions & 0 deletions
11
XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminSpatialMeshObserverProfile.cs.meta
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there anyway this might have a different name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. It's the dll found in the
com.unity.xr.magicleap
package.