// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; namespace Microsoft.MixedReality.Toolkit.Utilities { /// /// The Handedness defines which hand a controller is currently operating in. /// It is up to the developer to determine whether this affects the use of a controller or not. /// "Other" defines potential controllers that will offer a "third" hand, e.g. a full body tracking suit. /// [Flags] public enum Handedness : byte { /// /// No hand specified by the SDK for the controller /// None = 0 << 0, /// /// The controller is identified as being provided in a Left hand /// Left = 1 << 0, /// /// The controller is identified as being provided in a Right hand /// Right = 1 << 1, /// /// The controller is identified as being either left and/or right handed. /// Both = Left | Right, /// /// Reserved, for systems that provide alternate hand state. /// Other = 1 << 2, /// /// Global catchall, used to map actions to any controller (provided the controller supports it) /// /// Note, by default the specific hand actions will override settings mapped as both Any = Other | Left | Right, } /// /// Extension methods specific to the enum. /// public static class HandednessExtensions { /// /// Checks to determine if all bits in a provided mask are set. /// /// value. /// mask. /// /// True if all of the bits in the specified mask are set in the current value. /// public static bool IsMaskSet(this Handedness a, Handedness b) { return (a & b) == b; } } }