Skip to content

Commit f67e5b6

Browse files
authored
Merge pull request #10357 from keveleigh/releases/2.7.3
Releases/2.7.3 proposal
2 parents 60ccf7d + fcb5378 commit f67e5b6

File tree

191 files changed

+17373
-1856
lines changed

Some content is hidden

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

191 files changed

+17373
-1856
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT License.
3+
4+
using System;
5+
using UnityEngine;
6+
7+
namespace Microsoft.MixedReality.Toolkit
8+
{
9+
/// <summary>
10+
/// Attribute used to display a dropdown of registered keywords from the speech profile.
11+
/// </summary>
12+
[AttributeUsage(AttributeTargets.Field)]
13+
public sealed class SpeechKeywordAttribute : PropertyAttribute { }
14+
}

Assets/MRTK/Core/Attributes/SpeechKeywordAttribute.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.

Assets/MRTK/Core/Definitions/Devices/MixedRealityControllerVisualizationProfile.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ private bool SettingContainsParameters(MixedRealityControllerVisualizationSettin
248248
{
249249
return setting.ControllerType != null &&
250250
setting.ControllerType.Type == controllerType &&
251-
setting.Handedness.HasFlag(hand) && setting.Handedness != Handedness.None;
251+
setting.Handedness.IsMaskSet(hand) && setting.Handedness != Handedness.None;
252252
}
253253
}
254254
}

Assets/MRTK/Core/Definitions/Devices/SupportedControllerType.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,23 @@ public enum SupportedControllerType
2828
GGVHand = 1 << 11,
2929
HPMotionController = 1 << 12
3030
}
31+
32+
/// <summary>
33+
/// Extension methods specific to the <see cref="SupportedControllerType"/> enum.
34+
/// </summary>
35+
public static class SupportedControllerTypeExtensions
36+
{
37+
/// <summary>
38+
/// Checks to determine if all bits in a provided mask are set.
39+
/// </summary>
40+
/// <param name="a"><see cref="SupportedControllerType"/> value.</param>
41+
/// <param name="b"><see cref="SupportedControllerType"/> mask.</param>
42+
/// <returns>
43+
/// True if all of the bits in the specified mask are set in the current value.
44+
/// </returns>
45+
public static bool IsMaskSet(this SupportedControllerType a, SupportedControllerType b)
46+
{
47+
return (a & b) == b;
48+
}
49+
}
3150
}

Assets/MRTK/Core/Definitions/InputSystem/KeywordAndResponse.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public KeywordAndResponse(string keyword, UnityEvent response)
2626

2727
[SerializeField]
2828
[Tooltip("The keyword to listen for.")]
29+
[SpeechKeyword]
2930
private string keyword;
3031

3132
/// <summary>

Assets/MRTK/Core/Definitions/SpatialAwareness/SpatialAwarenessSurfaceTypes.cs

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ public enum SpatialAwarenessSurfaceTypes
4343
/// </remarks>
4444
Platform = 1 << 4,
4545

46-
// Insert additional surface types here.
47-
4846
/// <summary>
4947
/// A surface that does not fit one of the defined surface types.
5048
/// </summary>
@@ -53,16 +51,35 @@ public enum SpatialAwarenessSurfaceTypes
5351
/// <para>Background should not be confused with Unknown. There is sufficient data to
5452
/// classify the surface and it has been found to not correspond to a defined type.</para>
5553
/// </remarks>
56-
Background = 1 << 29,
54+
Background = 1 << 5,
5755

5856
/// <summary>
5957
/// A boundless world mesh.
6058
/// </summary>
61-
World = 1 << 30,
59+
World = 1 << 6,
6260

6361
/// <summary>
6462
/// Objects for which we have no observations
6563
/// </summary>
66-
Inferred = 1 << 31
64+
Inferred = 1 << 7
65+
}
66+
67+
/// <summary>
68+
/// Extension methods specific to the <see cref="SpatialAwarenessSurfaceTypes"/> enum.
69+
/// </summary>
70+
public static class SpatialAwarenessSurfaceTypesExtensions
71+
{
72+
/// <summary>
73+
/// Checks to determine if all bits in a provided mask are set.
74+
/// </summary>
75+
/// <param name="a"><see cref="SpatialAwarenessSurfaceTypes"/> value.</param>
76+
/// <param name="b"><see cref="SpatialAwarenessSurfaceTypes"/> mask.</param>
77+
/// <returns>
78+
/// True if all of the bits in the specified mask are set in the current value.
79+
/// </returns>
80+
public static bool IsMaskSet(this SpatialAwarenessSurfaceTypes a, SpatialAwarenessSurfaceTypes b)
81+
{
82+
return (a & b) == b;
83+
}
6784
}
6885
}

Assets/MRTK/Core/Definitions/Utilities/AxisFlags.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,23 @@ public enum AxisFlags
1313
YAxis = 1 << 1,
1414
ZAxis = 1 << 2
1515
}
16+
17+
/// <summary>
18+
/// Extension methods specific to the <see cref="AxisFlags"/> enum.
19+
/// </summary>
20+
public static class AxisFlagsExtensions
21+
{
22+
/// <summary>
23+
/// Checks to determine if all bits in a provided mask are set.
24+
/// </summary>
25+
/// <param name="a"><see cref="AxisFlags"/> value.</param>
26+
/// <param name="b"><see cref="AxisFlags"/> mask.</param>
27+
/// <returns>
28+
/// True if all of the bits in the specified mask are set in the current value.
29+
/// </returns>
30+
public static bool IsMaskSet(this AxisFlags a, AxisFlags b)
31+
{
32+
return (a & b) == b;
33+
}
34+
}
1635
}

Assets/MRTK/Core/Definitions/Utilities/Handedness.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,23 @@ public enum Handedness : byte
3939
/// <remarks>Note, by default the specific hand actions will override settings mapped as both</remarks>
4040
Any = Other | Left | Right,
4141
}
42+
43+
/// <summary>
44+
/// Extension methods specific to the <see cref="Handedness"/> enum.
45+
/// </summary>
46+
public static class HandednessExtensions
47+
{
48+
/// <summary>
49+
/// Checks to determine if all bits in a provided mask are set.
50+
/// </summary>
51+
/// <param name="a"><see cref="Handedness"/> value.</param>
52+
/// <param name="b"><see cref="Handedness"/> mask.</param>
53+
/// <returns>
54+
/// True if all of the bits in the specified mask are set in the current value.
55+
/// </returns>
56+
public static bool IsMaskSet(this Handedness a, Handedness b)
57+
{
58+
return (a & b) == b;
59+
}
60+
}
4261
}

Assets/MRTK/Core/Definitions/Utilities/ManipulationHandFlags.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,23 @@ public enum ManipulationHandFlags
1212
OneHanded = 1 << 0,
1313
TwoHanded = 1 << 1,
1414
}
15+
16+
/// <summary>
17+
/// Extension methods specific to the <see cref="ManipulationHandFlags"/> enum.
18+
/// </summary>
19+
public static class ManipulationHandFlagsExtensions
20+
{
21+
/// <summary>
22+
/// Checks to determine if all bits in a provided mask are set.
23+
/// </summary>
24+
/// <param name="a"><see cref="ManipulationHandFlags"/> value.</param>
25+
/// <param name="b"><see cref="ManipulationHandFlags"/> mask.</param>
26+
/// <returns>
27+
/// True if all of the bits in the specified mask are set in the current value.
28+
/// </returns>
29+
public static bool IsMaskSet(this ManipulationHandFlags a, ManipulationHandFlags b)
30+
{
31+
return (a & b) == b;
32+
}
33+
}
1534
}

Assets/MRTK/Core/Definitions/Utilities/ManipulationProximityFlags.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,23 @@ public enum ManipulationProximityFlags
1212
Near = 1 << 0,
1313
Far = 1 << 1,
1414
}
15+
16+
/// <summary>
17+
/// Extension methods specific to the <see cref="ManipulationProximityFlags"/> enum.
18+
/// </summary>
19+
public static class ManipulationProximityFlagsExtensions
20+
{
21+
/// <summary>
22+
/// Checks to determine if all bits in a provided mask are set.
23+
/// </summary>
24+
/// <param name="a"><see cref="ManipulationProximityFlags"/> value.</param>
25+
/// <param name="b"><see cref="ManipulationProximityFlags"/> mask.</param>
26+
/// <returns>
27+
/// True if all of the bits in the specified mask are set in the current value.
28+
/// </returns>
29+
public static bool IsMaskSet(this ManipulationProximityFlags a, ManipulationProximityFlags b)
30+
{
31+
return (a & b) == b;
32+
}
33+
}
1534
}

0 commit comments

Comments
 (0)