Struct XRFaceBlendShape
Represents a blend shape ID and its weight. For more information about blend shapes in Unity, refer to the tutorial Setting up Blendshapes in Unity.
Implements
Inherited Members
Namespace: UnityEngine.XR.ARSubsystems
Assembly: Unity.XR.ARSubsystems.dll
Syntax
public struct XRFaceBlendShape : IEquatable<XRFaceBlendShape>
Constructors
XRFaceBlendShape(int, float)
Constructs an instance with the given blend shape identifier and weight.
Declaration
public XRFaceBlendShape(int blendShapeId, float weight)
Parameters
Type | Name | Description |
---|---|---|
int | blendShapeId | The blend shape ID. |
float | weight | The weight, between 0.0 and 1.0. |
Properties
blendShapeId
The ID of the blend shape, as defined by the platform. Refer to Face tracking platform support to learn if your target platform supports blend shapes, and if so, refer the provider plug-in manual for that platform to understand the meaning of each ID value.
Declaration
public int blendShapeId { get; }
Property Value
Type | Description |
---|---|
int |
weight
A value from 0.0 (no influence) to 1.0 (maximum influence) that specifies the influence of this blend shape in the facial expression. The value may describe, for example, how closed is the left eye, how open is the mouth, etc.
Declaration
public float weight { get; }
Property Value
Type | Description |
---|---|
float |
Methods
Equals(object)
Tests for equality, using float.Equals
when comparing weights.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The |
Returns
Type | Description |
---|---|
bool | true if this face blend shape is equal to |
Overrides
Equals(XRFaceBlendShape)
Tests for equality, using float.Equals
when comparing weights.
Declaration
public bool Equals(XRFaceBlendShape other)
Parameters
Type | Name | Description |
---|---|---|
XRFaceBlendShape | other | The other face blend shape to compare against. |
Returns
Type | Description |
---|---|
bool | true if this face blend shape has the same ID and weight as |
GetHashCode()
Generates a hash suitable for use with containers like HashSet
and Dictionary
.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | This face blend shape's hash code. |
Overrides
Operators
operator ==(XRFaceBlendShape, XRFaceBlendShape)
Tests for equality. Equivalent to Equals(XRFaceBlendShape).
Declaration
public static bool operator ==(XRFaceBlendShape lhs, XRFaceBlendShape rhs)
Parameters
Type | Name | Description |
---|---|---|
XRFaceBlendShape | lhs | The instance to compare with |
XRFaceBlendShape | rhs | The instance to compare with |
Returns
Type | Description |
---|---|
bool | true if |
operator !=(XRFaceBlendShape, XRFaceBlendShape)
Tests for inequality. Equivalent to the negation of Equals(XRFaceBlendShape).
Declaration
public static bool operator !=(XRFaceBlendShape lhs, XRFaceBlendShape rhs)
Parameters
Type | Name | Description |
---|---|---|
XRFaceBlendShape | lhs | The instance to compare with |
XRFaceBlendShape | rhs | The instance to compare with |
Returns
Type | Description |
---|---|
bool | false if |