using System; using System.Runtime.InteropServices; namespace UnityEngine.XR.ARKit { /// /// Enum values that identify the face action units affecting the expression on the face. /// /// Each action unit corresponds to a facial feature that can move. A coefficient of zero for the /// feature represents the neutral position, while a coefficient of one represents the fully articulated /// position. /// /// Call to get the current coefficients of each /// blend shape location for the current facial expression. /// public enum ARKitBlendShapeLocation { /// /// The coefficient describing downward movement of the outer portion of the left eyebrow. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationbrowdownleft). /// BrowDownLeft, /// /// The coefficient describing downward movement of the outer portion of the right eyebrow. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationbrowdownright). /// BrowDownRight, /// /// The coefficient describing upward movement of the inner portion of both eyebrows. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationbrowinnerup). /// BrowInnerUp, /// /// The coefficient describing upward movement of the outer portion of the left eyebrow. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationbrowouterupleft). /// BrowOuterUpLeft, /// /// The coefficient describing upward movement of the outer portion of the right eyebrow. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationbrowouterupright). /// BrowOuterUpRight, /// /// The coefficient describing outward movement of both cheeks. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationcheekpuff). /// CheekPuff, /// /// The coefficient describing upward movement of the cheek around and below the left eye. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationcheeksquintleft). /// CheekSquintLeft, /// /// The coefficient describing upward movement of the cheek around and below the right eye. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationcheeksquintright). /// CheekSquintRight, /// /// The coefficient describing closure of the eyelids over the left eye. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationeyeblinkleft). /// EyeBlinkLeft, /// /// The coefficient describing closure of the eyelids over the right eye. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationeyeblinkright). /// EyeBlinkRight, /// /// The coefficient describing movement of the left eyelids consistent with a downward gaze. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationeyelookdownleft). /// EyeLookDownLeft, /// /// The coefficient describing movement of the right eyelids consistent with a downward gaze. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationeyelookdownright). /// EyeLookDownRight, /// /// The coefficient describing movement of the left eyelids consistent with a rightward gaze. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationeyelookinleft). /// EyeLookInLeft, /// /// The coefficient describing movement of the right eyelids consistent with a leftward gaze. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationeyelookinright). /// EyeLookInRight, /// /// The coefficient describing movement of the left eyelids consistent with a leftward gaze. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationeyelookoutleft). /// EyeLookOutLeft, /// /// The coefficient describing movement of the right eyelids consistent with a rightward gaze. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationeyelookoutright). /// EyeLookOutRight, /// /// The coefficient describing movement of the left eyelids consistent with an upward gaze. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationeyelookupleft). /// EyeLookUpLeft, /// /// The coefficient describing movement of the right eyelids consistent with an upward gaze. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationeyelookupright). /// EyeLookUpRight, /// /// The coefficient describing contraction of the face around the left eye. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationeyesquintleft). /// EyeSquintLeft, /// /// The coefficient describing contraction of the face around the right eye. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationeyesquintright). /// EyeSquintRight, /// /// The coefficient describing a widening of the eyelids around the left eye. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationeyewideleft). /// EyeWideLeft, /// /// The coefficient describing a widening of the eyelids around the right eye. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationeyewideright). /// EyeWideRight, /// /// The coefficient describing forward movement of the lower jaw. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationjawforward). /// JawForward, /// /// The coefficient describing leftward movement of the lower jaw. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationjawleft). /// JawLeft, /// /// The coefficient describing an opening of the lower jaw. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationjawopen). /// JawOpen, /// /// The coefficient describing rightward movement of the lower jaw. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationjawright). /// JawRight, /// /// The coefficient describing closure of the lips independent of jaw position. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationmouthclose). /// MouthClose, /// /// The coefficient describing backward movement of the left corner of the mouth. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationmouthdimpleleft). /// MouthDimpleLeft, /// /// The coefficient describing backward movement of the right corner of the mouth. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationmouthdimpleright). /// MouthDimpleRight, /// /// The coefficient describing downward movement of the left corner of the mouth. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationmouthfrownleft). /// MouthFrownLeft, /// /// The coefficient describing downward movement of the right corner of the mouth. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationmouthfrownright). /// MouthFrownRight, /// /// The coefficient describing contraction of both lips into an open shape. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationmouthfunnel). /// MouthFunnel, /// /// The coefficient describing leftward movement of both lips together. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationmouthleft). /// MouthLeft, /// /// The coefficient describing downward movement of the lower lip on the left side. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationmouthlowerdownleft). /// MouthLowerDownLeft, /// /// The coefficient describing downward movement of the lower lip on the right side. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationmouthlowerdownright). /// MouthLowerDownRight, /// /// The coefficient describing upward compression of the lower lip on the left side. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationmouthpressleft). /// MouthPressLeft, /// /// The coefficient describing upward compression of the lower lip on the right side. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationmouthpressright). /// MouthPressRight, /// /// The coefficient describing contraction and compression of both closed lips. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationmouthpucker). /// MouthPucker, /// /// The coefficient describing rightward movement of both lips together. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationmouthright). /// MouthRight, /// /// The coefficient describing movement of the lower lip toward the inside of the mouth. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationmouthrolllower). /// MouthRollLower, /// /// The coefficient describing movement of the upper lip toward the inside of the mouth. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationmouthrollupper). /// MouthRollUpper, /// /// The coefficient describing outward movement of the lower lip. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationmouthshruglower). /// MouthShrugLower, /// /// The coefficient describing outward movement of the upper lip. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationmouthshrugupper). /// MouthShrugUpper, /// /// The coefficient describing upward movement of the left corner of the mouth. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationmouthsmileleft). /// MouthSmileLeft, /// /// The coefficient describing upward movement of the right corner of the mouth. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationmouthsmileright). /// MouthSmileRight, /// /// The coefficient describing leftward movement of the left corner of the mouth. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationmouthstretchleft). /// MouthStretchLeft, /// /// The coefficient describing rightward movement of the left corner of the mouth. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationmouthstretchright). /// MouthStretchRight, /// /// The coefficient describing upward movement of the upper lip on the left side. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationmouthupperupleft). /// MouthUpperUpLeft, /// /// The coefficient describing upward movement of the upper lip on the right side. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationmouthupperupright). /// MouthUpperUpRight, /// /// The coefficient describing a raising of the left side of the nose around the nostril. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationnosesneerleft). /// NoseSneerLeft, /// /// The coefficient describing a raising of the right side of the nose around the nostril. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationnosesneerright). /// NoseSneerRight, /// /// The coefficient describing extension of the tongue. /// For more information, please refer to the /// [ARKit documentation](https://developer.apple.com/documentation/arkit/arblendshapelocationtongueout). /// TongueOut } /// /// An entry that specifies how much of a specific is present in the current expression on the face. /// /// /// Call to get the list of coefficients for each /// blend shape location of the current facial expression. /// [StructLayout(LayoutKind.Sequential)] public struct ARKitBlendShapeCoefficient : IEquatable { // Fields to marshall/serialize from native code ARKitBlendShapeLocation m_BlendShapeLocation; float m_Coefficient; /// /// The specific being examined. /// /// Identifies the action unit for this coefficient value. public ARKitBlendShapeLocation blendShapeLocation => m_BlendShapeLocation; /// /// A value from 0.0 to 1.0 that specifies how active the associated is in this expression. /// /// A coefficient of zero represents a neutral position of this blend shape, while a coefficient of one /// represents a fully articulated position. public float coefficient => m_Coefficient; /// /// Tests for equality. /// /// The other to compare against. /// `True` if every field in is equal to this , otherwise false. public bool Equals(ARKitBlendShapeCoefficient other) { return (blendShapeLocation == other.blendShapeLocation) && coefficient.Equals(other.coefficient); } /// /// Tests for equality. /// /// The `object` to compare against. /// `True` if is of type and /// also returns `true`; otherwise `false`. public override bool Equals(object obj) => (obj is ARKitBlendShapeCoefficient other) && Equals(other); /// /// Generates a hash suitable for use with containers like `HashSet` and `Dictionary`. /// /// A hash code generated from this object's fields. public override int GetHashCode() { unchecked { var hash = ((int)m_BlendShapeLocation).GetHashCode(); hash = hash * 486187739 + coefficient.GetHashCode(); return hash; } } /// /// Tests for equality. Same as . /// /// The left-hand side of the comparison. /// The right-hand side of the comparison. /// `True` if is equal to , otherwise `false`. public static bool operator==(ARKitBlendShapeCoefficient lhs, ARKitBlendShapeCoefficient rhs) => lhs.Equals(rhs); /// /// Tests for inequality. Same as `!`. /// /// The left-hand side of the comparison. /// The right-hand side of the comparison. /// `True` if is not equal to , otherwise `false`. public static bool operator!=(ARKitBlendShapeCoefficient lhs, ARKitBlendShapeCoefficient rhs) => !lhs.Equals(rhs); } }