Package org.lwjgl.ovr

Class OVRLayerCube

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

    public class OVRLayerCube
    extends Struct
    implements NativeResource
    Describes a layer of type LayerType_Cube which is a single timewarped cubemap at infinity. When looking down the recentered origin's -Z axis, +X face is left and +Y face is up. Similarly, if headlocked the +X face is left, +Y face is up and -Z face is forward. Note that the coordinate system is left-handed.

    LayerFlag_TextureOriginAtBottomLeft flag is not supported by ovrLayerCube.

    Member documentation

    • HeaderHeader.Type must be LayerType_Cube
    • Orientation – orientation of the cube
    • CubeMapTexture – contains a single cubemap swapchain (not a stereo pair of swapchains)

    Layout

    
     struct ovrLayerCube {
         ovrLayerHeader Header;
         ovrQuatf Orientation;
         ovrTextureSwapChain CubeMapTexture;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • HEADER, ORIENTATION, CUBEMAPTEXTURE

        The struct member offsets.
    • Constructor Detail

      • OVRLayerCube

        public OVRLayerCube​(java.nio.ByteBuffer container)
        Creates a OVRLayerCube 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
      • Header

        public OVRLayerCube Header​(java.util.function.Consumer<OVRLayerHeader> consumer)
        Passes the Header field to the specified Consumer.
      • Orientation

        public OVRQuatf Orientation()
        Returns a OVRQuatf view of the Orientation field.
      • Orientation

        public OVRLayerCube Orientation​(java.util.function.Consumer<OVRQuatf> consumer)
        Passes the Orientation field to the specified Consumer.
      • CubeMapTexture

        public long CubeMapTexture()
        Returns the value of the CubeMapTexture field.
      • CubeMapTexture

        public OVRLayerCube CubeMapTexture​(long value)
        Sets the specified value to the CubeMapTexture field.
      • set

        public OVRLayerCube set​(OVRLayerCube src)
        Copies the specified struct data to this struct.
        Parameters:
        src - the source struct
        Returns:
        this struct
      • create

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

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

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

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

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

        public static OVRLayerCube.Buffer callocStack​(int capacity)
        Returns a new OVRLayerCube.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
        Parameters:
        capacity - the buffer capacity
      • callocStack

        public static OVRLayerCube.Buffer callocStack​(int capacity,
                                                      MemoryStack stack)
        Returns a new OVRLayerCube.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • nCubeMapTexture

        public static long nCubeMapTexture​(long struct)
        Unsafe version of CubeMapTexture().
      • nHeader

        public static void nHeader​(long struct,
                                   OVRLayerHeader value)
        Unsafe version of Header.
      • nOrientation

        public static void nOrientation​(long struct,
                                        OVRQuatf value)
        Unsafe version of Orientation.
      • nCubeMapTexture

        public static void nCubeMapTexture​(long struct,
                                           long value)
        Unsafe version of CubeMapTexture.
      • validate

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

        public static void validate​(long array,
                                    int count)
        Calls validate(long) for each struct contained in the specified struct array.
        Parameters:
        array - the struct array to validate
        count - the number of structs in array