Skip to content

Commit 591a248

Browse files
author
David Kline
authored
Merge pull request #2725 from davidkline-ms/spatialAwareness_scaffolding
Implement spatial awareness scaffolding
2 parents 332012c + 61b6b61 commit 591a248

File tree

83 files changed

+2866
-184
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+2866
-184
lines changed

Assets/MixedRealityToolkit/Spatial.meta renamed to Assets/MixedRealityToolkit-SDK/Features/SpatialAwareness.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/MixedRealityToolkit/Spatial/Mapping.meta renamed to Assets/MixedRealityToolkit-SDK/Features/SpatialAwareness/System.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/MixedRealityToolkit/Spatial/Sound.meta renamed to Assets/MixedRealityToolkit-SDK/Features/SpatialAwareness/System/Handlers.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See LICENSE in the project root for license information.
3+
4+
using Microsoft.MixedReality.Toolkit.Core.EventDatum.SpatialAwarenessSystem;
5+
using Microsoft.MixedReality.Toolkit.Core.Interfaces.SpatialAwarenessSystem.Handlers;
6+
7+
namespace Microsoft.MixedReality.Toolkit.SDK.SpatialAwarenessSystem.Handlers
8+
{
9+
/// <summary>
10+
/// Class providing the default implementation of the <see cref="IMixedRealitySpatialAwarenessMeshHandler"/> interface.
11+
/// </summary>
12+
public class MixedRealitySpatialAwarehessMeshHandler : IMixedRealitySpatialAwarenessMeshHandler
13+
{
14+
/// <inheritdoc />
15+
public void OnMeshAdded(MixedRealitySpatialAwarenessMeshEventData eventData)
16+
{
17+
// todo
18+
}
19+
20+
/// <inheritdoc />
21+
public void OnMeshUpdated(MixedRealitySpatialAwarenessMeshEventData eventData)
22+
{
23+
// todo
24+
}
25+
26+
/// <inheritdoc />
27+
public void OnMeshRemoved(MixedRealitySpatialAwarenessMeshEventData eventData)
28+
{
29+
// todo
30+
}
31+
}
32+
}

Assets/MixedRealityToolkit-SDK/Features/SpatialAwareness/System/Handlers/MixedRealitySpatialAwarehessMeshHandler.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See LICENSE in the project root for license information.
3+
4+
using Microsoft.MixedReality.Toolkit.Core.EventDatum.SpatialAwarenessSystem;
5+
using Microsoft.MixedReality.Toolkit.Core.Interfaces.SpatialAwarenessSystem.Handlers;
6+
7+
namespace Microsoft.MixedReality.Toolkit.SDK.SpatialAwarenessSystem.Handlers
8+
{
9+
/// <summary>
10+
/// Class providing the default implementation of the <see cref="IMixedRealitySpatialAwarenessSurfaceFindingHandler"/> interface.
11+
/// </summary>
12+
public class MixedRealitySpatialAwarenessSurfaceFindingHandler : IMixedRealitySpatialAwarenessSurfaceFindingHandler
13+
{
14+
/// <inheritdoc />
15+
public void OnSurfaceAdded(MixedRealitySpatialAwarenessSurfaceFindingEventData eventData)
16+
{
17+
// todo
18+
}
19+
20+
/// <inheritdoc />
21+
public void OnSurfaceUpdated(MixedRealitySpatialAwarenessSurfaceFindingEventData eventData)
22+
{
23+
// todo
24+
}
25+
26+
/// <inheritdoc />
27+
public void OnSurfaceRemoved(MixedRealitySpatialAwarenessSurfaceFindingEventData eventData)
28+
{
29+
// todo
30+
}
31+
}
32+
}

Assets/MixedRealityToolkit-SDK/Features/SpatialAwareness/System/Handlers/MixedRealitySpatialAwarenessSurfaceFindingHandler.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See LICENSE in the project root for license information.
3+
4+
using Microsoft.MixedReality.Toolkit.Core.Definitions.SpatialAwarenessSystem;
5+
using System.Collections;
6+
using UnityEngine;
7+
8+
namespace Microsoft.MixedReality.Toolkit.SDK.SpatialAwarenessSystem
9+
{
10+
/// <summary>
11+
/// Class poviding the default implementation of the <see cref="IMixedRealitySpatialAwarenessBaseDescription"/> interface.
12+
/// </summary>
13+
public class MixedRealitySpatialAwarenessBaseDescription : IMixedRealitySpatialAwarenessBaseDescription
14+
{
15+
/// <inheritdoc />
16+
public Vector3 Position { get; private set; }
17+
18+
public MixedRealitySpatialAwarenessBaseDescription(Vector3 position)
19+
{
20+
Position = position;
21+
}
22+
23+
#region IEqualityComparer implementation
24+
25+
public static bool Equals(IMixedRealitySpatialAwarenessBaseDescription left, IMixedRealitySpatialAwarenessBaseDescription right)
26+
{
27+
return left.Equals(right);
28+
}
29+
30+
bool IEqualityComparer.Equals(object left, object right)
31+
{
32+
return left.Equals(right);
33+
}
34+
35+
public override bool Equals(object obj)
36+
{
37+
if (ReferenceEquals(null, obj)) { return false; }
38+
if (ReferenceEquals(this, obj)) { return true; }
39+
if (obj.GetType() != GetType()) { return false; }
40+
41+
return Equals((IMixedRealitySpatialAwarenessBaseDescription)obj);
42+
}
43+
44+
private bool Equals(IMixedRealitySpatialAwarenessBaseDescription other)
45+
{
46+
if (other == null) { return false; }
47+
48+
return Position.Equals(other.Position);
49+
}
50+
51+
int IEqualityComparer.GetHashCode(object obj)
52+
{
53+
return obj.GetHashCode();
54+
}
55+
56+
public override int GetHashCode()
57+
{
58+
string s = $"Position({Position})";
59+
return s.GetHashCode();
60+
}
61+
62+
#endregion IEqualityComparer implementation
63+
}
64+
}

Assets/MixedRealityToolkit-SDK/Features/SpatialAwareness/System/MixedRealitySpatialAwarenessBaseDescription.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See LICENSE in the project root for license information.
3+
4+
using Microsoft.MixedReality.Toolkit.Core.Definitions.SpatialAwarenessSystem;
5+
using System.Collections;
6+
using UnityEngine;
7+
8+
namespace Microsoft.MixedReality.Toolkit.SDK.SpatialAwarenessSystem
9+
{
10+
/// <summary>
11+
/// Class poviding the default implementation of the <see cref="IMixedRealitySpatialAwarenessMeshDescription"/> interface.
12+
/// </summary>
13+
public class MixedRealitySpatialAwarenessMeshDescription : MixedRealitySpatialAwarenessBaseDescription, IMixedRealitySpatialAwarenessMeshDescription
14+
{
15+
/// <inheritdoc />
16+
public Mesh Mesh {get; private set;}
17+
18+
public MixedRealitySpatialAwarenessMeshDescription(Vector3 position, Mesh mesh) : base(position)
19+
{
20+
Mesh = mesh;
21+
}
22+
23+
#region IEqualityComparer implementation
24+
25+
public static bool Equals(IMixedRealitySpatialAwarenessMeshDescription left, IMixedRealitySpatialAwarenessMeshDescription right)
26+
{
27+
return left.Equals(right);
28+
}
29+
30+
bool IEqualityComparer.Equals(object left, object right)
31+
{
32+
return left.Equals(right);
33+
}
34+
35+
public override bool Equals(object obj)
36+
{
37+
if (ReferenceEquals(null, obj)) { return false; }
38+
if (ReferenceEquals(this, obj)) { return true; }
39+
if (obj.GetType() != GetType()) { return false; }
40+
41+
return Equals((IMixedRealitySpatialAwarenessMeshDescription)obj);
42+
}
43+
44+
private bool Equals(IMixedRealitySpatialAwarenessMeshDescription other)
45+
{
46+
if (other == null) { return false; }
47+
if (!base.Equals(other)) { return false; }
48+
49+
return Mesh.Equals(other.Mesh);
50+
}
51+
52+
int IEqualityComparer.GetHashCode(object obj)
53+
{
54+
return obj.GetHashCode();
55+
}
56+
57+
public override int GetHashCode()
58+
{
59+
string s = $"Position({Position}):MeshHash({Mesh.GetHashCode()}";
60+
return s.GetHashCode();
61+
}
62+
63+
#endregion IEqualityComparer implementation
64+
}
65+
}

0 commit comments

Comments
 (0)