Class XrHapticVibration

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

public class XrHapticVibration extends org.lwjgl.system.Struct<XrHapticVibration> implements org.lwjgl.system.NativeResource
Base header for haptic feedback.
Description

The XrHapticVibration is used in calls to ApplyHapticFeedback that trigger actionname:vibration output actions.

The duration, and frequency parameters may be clamped to implementation-dependent ranges.

Valid Usage (Implicit)
See Also

XrHapticBaseHeader, ApplyHapticFeedback

Layout


 struct XrHapticVibration {
     XrStructureType type();
     void const * next();
     XrDuration duration();
     float frequency();
     float amplitude();
 }
  • 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.
    • DURATION

      public static final int DURATION
      The struct member offsets.
    • FREQUENCY

      public static final int FREQUENCY
      The struct member offsets.
    • AMPLITUDE

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

    • XrHapticVibration

      public XrHapticVibration(ByteBuffer container)
      Creates a XrHapticVibration 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<XrHapticVibration>
    • 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.
    • duration

      public long duration()
      the number of nanoseconds the vibration should last. If MIN_HAPTIC_DURATION is specified, the runtime must produce a short haptics pulse of minimal supported duration for the haptic device.
    • frequency

      public float frequency()
      the frequency of the vibration in Hz. If FREQUENCY_UNSPECIFIED is specified, it is left to the runtime to decide the optimal frequency value to use.
    • amplitude

      public float amplitude()
      the amplitude of the vibration between 0.0 and 1.0.
    • type

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

      public XrHapticVibration type$Default()
      Sets the TYPE_HAPTIC_VIBRATION value to the type() field.
    • next

      public XrHapticVibration next(long value)
      Sets the specified value to the next() field.
    • duration

      public XrHapticVibration duration(long value)
      Sets the specified value to the duration() field.
    • frequency

      public XrHapticVibration frequency(float value)
      Sets the specified value to the frequency() field.
    • amplitude

      public XrHapticVibration amplitude(float value)
      Sets the specified value to the amplitude() field.
    • set

      public XrHapticVibration set(int type, long next, long duration, float frequency, float amplitude)
      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 XrHapticVibration malloc()
      Returns a new XrHapticVibration instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

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

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

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

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

      public static XrHapticVibration create(XrHapticBaseHeader value)
      Downcasts the specified XrHapticBaseHeader instance to XrHapticVibration.
    • malloc

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

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

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

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

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

      Downcasts the specified XrHapticBaseHeader.Buffer instance to XrHapticVibration.Buffer.
    • malloc

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

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

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

      public static XrHapticVibration.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new XrHapticVibration.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().
    • nduration

      public static long nduration(long struct)
      Unsafe version of duration().
    • nfrequency

      public static float nfrequency(long struct)
      Unsafe version of frequency().
    • namplitude

      public static float namplitude(long struct)
      Unsafe version of amplitude().
    • 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.
    • nduration

      public static void nduration(long struct, long value)
      Unsafe version of duration.
    • nfrequency

      public static void nfrequency(long struct, float value)
      Unsafe version of frequency.
    • namplitude

      public static void namplitude(long struct, float value)
      Unsafe version of amplitude.