8000 Dev spatial awareness by StephenHodgson · Pull Request #20 · XRTK/com.xrtk.lumin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on May 13, 2022. It is now read-only.

Dev spatial awareness #20

Merged
merged 4 commits into from
May 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
{
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 61 additions & 0 deletions XRTK.Lumin/Packages/com.xrtk.lumin/LuminApi.cs
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";

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?

Copy link
Contributor Author

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.


[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
11 changes: 11 additions & 0 deletions XRTK.Lumin/Packages/com.xrtk.lumin/LuminApi.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.

Loading
0