Package org.lwjgl.ovr

Class OVRHapticsClip

  • All Implemented Interfaces:
    java.lang.AutoCloseable, NativeResource, Pointer

    public class OVRHapticsClip
    extends Struct
    implements NativeResource
    Store a full Haptics clip, which can be used as data source for multiple OVRHapticsBuffer.

    Member documentation

    • Samples – samples stored in opaque format
    • SamplesCount – number of samples

    Layout

    
     struct ovrHapticsClip {
         void const * Samples;
         int SamplesCount;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • SAMPLES, SAMPLESCOUNT

        The struct member offsets.
    • Constructor Detail

      • OVRHapticsClip

        public OVRHapticsClip​(java.nio.ByteBuffer container)
        Creates a OVRHapticsClip 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 Detail

      • sizeof

        public int sizeof()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • Samples

        public java.nio.ByteBuffer Samples​(int capacity)
        Returns a ByteBuffer view of the data pointed to by the Samples field.
        Parameters:
        capacity - the number of elements in the returned buffer
      • SamplesCount

        public int SamplesCount()
        Returns the value of the SamplesCount field.
      • malloc

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

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

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

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

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

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

        public static OVRHapticsClip mallocStack()
        Returns a new OVRHapticsClip instance allocated on the thread-local MemoryStack.
      • callocStack

        public static OVRHapticsClip callocStack()
        Returns a new OVRHapticsClip instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

        public static OVRHapticsClip mallocStack​(MemoryStack stack)
        Returns a new OVRHapticsClip instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static OVRHapticsClip callocStack​(MemoryStack stack)
        Returns a new OVRHapticsClip instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • nSamples

        public static java.nio.ByteBuffer nSamples​(long struct,
                                                   int capacity)
        Unsafe version of Samples.
      • nSamplesCount

        public static int nSamplesCount​(long struct)
        Unsafe version of SamplesCount().