Class XrFaceExpressionWeights2FB

java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<XrFaceExpressionWeights2FB>
org.lwjgl.openxr.XrFaceExpressionWeights2FB
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

public class XrFaceExpressionWeights2FB extends org.lwjgl.system.Struct<XrFaceExpressionWeights2FB> implements org.lwjgl.system.NativeResource
Returns the facial expression.
Description

XrFaceExpressionWeights2FB structure returns the facial expression.

The runtime must return ERROR_VALIDATION_FAILURE if weightCount is not equal to the number of blend shapes defined by the XrFaceExpressionSet2FB used to create the XrFaceTracker2FB.

The runtime must return ERROR_VALIDATION_FAILURE if confidenceCount is not equal to the number of confidence areas defined by the XrFaceExpressionSet2FB used to create the XrFaceTracker2FB.

The runtime must return weights representing the weights of blend shapes of current facial expression.

The runtime must update the weights array ordered so that the application can index elements using the corresponding facial expression enum (e.g. XrFaceExpression2FB) as described by XrFaceExpressionSet2FB when creating the XrFaceTracker2FB. For example, when the XrFaceTracker2FB is created with FACE_EXPRESSION_SET2_DEFAULT_FB, the application sets the weightCount to FACE_EXPRESSION2_COUNT_FB, and the runtime must fill the weights array ordered so that it can be indexed by the XrFaceExpression2FB enum.

The runtime must update the confidences array ordered so that the application can index elements using the corresponding confidence area enum (e.g. XrFaceConfidence2FB) as described by XrFaceExpressionSet2FB when creating the XrFaceTracker2FB. For example, when the XrFaceTracker2FB is created with FACE_EXPRESSION_SET2_DEFAULT_FB, the application sets the confidenceCount to FACE_CONFIDENCE2_COUNT_FB, and the runtime must fill the confidences array ordered so that it can be indexed by the XrFaceConfidence2FB enum.

The runtime must set isValid to FALSE and it must also set all elements of weights to zero, if one of the following is true:

  • the face tracker failed to track or lost track of the face
  • the application lost focus
  • the consent for face tracking was denied
  • the runtime is unable to estimate facial expression from the data sources specified when CreateFaceTracker2FB function was called

If the returned isValid is TRUE, the runtime must return all weights (or all weights except eyes related weights, see isEyeFollowingBlendshapesValid).

The runtime must set isEyeFollowingBlendshapesValid to FALSE and it must also set 8 expression weights with prefix XR_FACE_EXPRESSION2_EYES_LOOK_* to zero, if one of the following is true:

  • the eye tracking driving blendshapes with prefix XR_FACE_EXPRESSION2_EYES_LOOK_* lost track
  • the consent for eye tracking was denied
Valid Usage (Implicit)
See Also

GetFaceExpressionWeights2FB

Layout


 struct XrFaceExpressionWeights2FB {
     XrStructureType type();
     void * next();
     uint32_t weightCount();
     float * weights();
     uint32_t confidenceCount();
     float * confidences();
     XrBool32 isValid();
     XrBool32 isEyeFollowingBlendshapesValid();
     XrFaceTrackingDataSource2FB dataSource();
     XrTime time();
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • TYPE

      public static final int TYPE
      The struct member offsets.
    • NEXT

      public static final int NEXT
      The struct member offsets.
    • WEIGHTCOUNT

      public static final int WEIGHTCOUNT
      The struct member offsets.
    • WEIGHTS

      public static final int WEIGHTS
      The struct member offsets.
    • CONFIDENCECOUNT

      public static final int CONFIDENCECOUNT
      The struct member offsets.
    • CONFIDENCES

      public static final int CONFIDENCES
      The struct member offsets.
    • ISVALID

      public static final int ISVALID
      The struct member offsets.
    • ISEYEFOLLOWINGBLENDSHAPESVALID

      public static final int ISEYEFOLLOWINGBLENDSHAPESVALID
      The struct member offsets.
    • DATASOURCE

      public static final int DATASOURCE
      The struct member offsets.
    • TIME

      public static final int TIME
      The struct member offsets.
  • Constructor Details

    • XrFaceExpressionWeights2FB

      public XrFaceExpressionWeights2FB(ByteBuffer container)
      Creates a XrFaceExpressionWeights2FB instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

      The created instance holds a strong reference to the container object.

  • Method Details

    • sizeof

      public int sizeof()
      Specified by:
      sizeof in class org.lwjgl.system.Struct<XrFaceExpressionWeights2FB>
    • type

      public int type()
      the XrStructureType of this structure.
    • next

      public long next()
      NULL or a pointer to the next structure in a structure chain. No such structures are defined in core OpenXR or this extension.
    • weightCount

      public int weightCount()
      a uint32_t describing the count of elements in weights array.
    • weights

      public FloatBuffer weights()
      a pointer to an application-allocated array of float that will be filled with weights of facial expression blend shapes.
    • confidenceCount

      public int confidenceCount()
      a uint32_t describing the count of elements in confidences array.
    • confidences

      public FloatBuffer confidences()
      a pointer to an application-allocated array of float that will be filled with confidence of tracking specific parts of a face.
    • isValid

      public boolean isValid()
      an XrBool32 which indicates that the tracked expression weights are valid.
    • isEyeFollowingBlendshapesValid

      public boolean isEyeFollowingBlendshapesValid()
      an XrBool32 which indicates if the 8 expression weights with prefix XR_FACE_EXPRESSION2_EYES_LOOK_* are valid.
    • dataSource

      public int dataSource()
      an XrFaceTrackingDataSource2FB which indicates the data source that was used to estimate the facial expression.
    • time

      public long time()
      an XrTime time at which the returned expression weights are tracked or extrapolated to. Equals the time at which the expression weights were requested if the extrapolating at the time was successful.
    • type

      public XrFaceExpressionWeights2FB type(int value)
      Sets the specified value to the type() field.
    • type$Default

      public XrFaceExpressionWeights2FB type$Default()
      Sets the TYPE_FACE_EXPRESSION_WEIGHTS2_FB value to the type() field.
    • next

      public XrFaceExpressionWeights2FB next(long value)
      Sets the specified value to the next() field.
    • weights

      public XrFaceExpressionWeights2FB weights(FloatBuffer value)
      Sets the address of the specified FloatBuffer to the weights() field.
    • confidences

      public XrFaceExpressionWeights2FB confidences(FloatBuffer value)
      Sets the address of the specified FloatBuffer to the confidences() field.
    • isValid

      public XrFaceExpressionWeights2FB isValid(boolean value)
      Sets the specified value to the isValid() field.
    • isEyeFollowingBlendshapesValid

      public XrFaceExpressionWeights2FB isEyeFollowingBlendshapesValid(boolean value)
      Sets the specified value to the isEyeFollowingBlendshapesValid() field.
    • dataSource

      public XrFaceExpressionWeights2FB dataSource(int value)
      Sets the specified value to the dataSource() field.
    • time

      public XrFaceExpressionWeights2FB time(long value)
      Sets the specified value to the time() field.
    • set

      public XrFaceExpressionWeights2FB set(int type, long next, FloatBuffer weights, FloatBuffer confidences, boolean isValid, boolean isEyeFollowingBlendshapesValid, int dataSource, long time)
      Initializes this struct with the specified values.
    • set

      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

      public static XrFaceExpressionWeights2FB malloc()
      Returns a new XrFaceExpressionWeights2FB instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static XrFaceExpressionWeights2FB calloc()
      Returns a new XrFaceExpressionWeights2FB instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static XrFaceExpressionWeights2FB create()
      Returns a new XrFaceExpressionWeights2FB instance allocated with BufferUtils.
    • create

      public static XrFaceExpressionWeights2FB create(long address)
      Returns a new XrFaceExpressionWeights2FB instance for the specified memory address.
    • createSafe

      public static @Nullable XrFaceExpressionWeights2FB createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static XrFaceExpressionWeights2FB.Buffer malloc(int capacity)
      Returns a new XrFaceExpressionWeights2FB.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static XrFaceExpressionWeights2FB.Buffer calloc(int capacity)
      Returns a new XrFaceExpressionWeights2FB.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static XrFaceExpressionWeights2FB.Buffer create(int capacity)
      Returns a new XrFaceExpressionWeights2FB.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static XrFaceExpressionWeights2FB.Buffer create(long address, int capacity)
      Create a XrFaceExpressionWeights2FB.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable XrFaceExpressionWeights2FB.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • malloc

      public static XrFaceExpressionWeights2FB malloc(org.lwjgl.system.MemoryStack stack)
      Returns a new XrFaceExpressionWeights2FB instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static XrFaceExpressionWeights2FB calloc(org.lwjgl.system.MemoryStack stack)
      Returns a new XrFaceExpressionWeights2FB instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static XrFaceExpressionWeights2FB.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new XrFaceExpressionWeights2FB.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static XrFaceExpressionWeights2FB.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new XrFaceExpressionWeights2FB.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • ntype

      public static int ntype(long struct)
      Unsafe version of type().
    • nnext

      public static long nnext(long struct)
      Unsafe version of next().
    • nweightCount

      public static int nweightCount(long struct)
      Unsafe version of weightCount().
    • nweights

      public static FloatBuffer nweights(long struct)
      Unsafe version of weights.
    • nconfidenceCount

      public static int nconfidenceCount(long struct)
      Unsafe version of confidenceCount().
    • nconfidences

      public static FloatBuffer nconfidences(long struct)
      Unsafe version of confidences.
    • nisValid

      public static int nisValid(long struct)
      Unsafe version of isValid().
    • nisEyeFollowingBlendshapesValid

      public static int nisEyeFollowingBlendshapesValid(long struct)
    • ndataSource

      public static int ndataSource(long struct)
      Unsafe version of dataSource().
    • ntime

      public static long ntime(long struct)
      Unsafe version of time().
    • ntype

      public static void ntype(long struct, int value)
      Unsafe version of type.
    • nnext

      public static void nnext(long struct, long value)
      Unsafe version of next.
    • nweightCount

      public static void nweightCount(long struct, int value)
      Sets the specified value to the weightCount field of the specified struct.
    • nweights

      public static void nweights(long struct, FloatBuffer value)
      Unsafe version of weights.
    • nconfidenceCount

      public static void nconfidenceCount(long struct, int value)
      Sets the specified value to the confidenceCount field of the specified struct.
    • nconfidences

      public static void nconfidences(long struct, FloatBuffer value)
      Unsafe version of confidences.
    • nisValid

      public static void nisValid(long struct, int value)
      Unsafe version of isValid.
    • nisEyeFollowingBlendshapesValid

      public static void nisEyeFollowingBlendshapesValid(long struct, int value)
    • ndataSource

      public static void ndataSource(long struct, int value)
      Unsafe version of dataSource.
    • ntime

      public static void ntime(long struct, long value)
      Unsafe version of time.
    • validate

      public static void validate(long struct)
      Validates pointer members that should not be NULL.
      Parameters:
      struct - the struct to validate