Package org.lwjgl.ovr

Class OVRLayerCylinder

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

    public class OVRLayerCylinder
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    Describes a layer of type LayerType_Cylinder which is a single cylinder relative to the recentered origin. This type of layer represents a single object placed in the world and not a stereo view of the world itself.
    
                    -Z                                       +Y
             U=0  +--+--+  U=1
              +---+  |  +---+            +-----------------+  - V=0
           +--+ \    |    / +--+         |                 |  |
         +-+     \       /     +-+       |                 |  |
        ++        \  A  /        ++      |                 |  |
       ++          \---/          ++     |                 |  |
       |            \ /            |     |              +X |  |
       +-------------C------R------+ +X  +--------C--------+  | <--- Height
           (+Y is out of screen)         |                 |  |
                                         |                 |  |
       R = Radius                        |                 |  |
       A = Angle (0,2*Pi)                |                 |  |
       C = CylinderPoseCenter            |                 |  |
       U/V = UV Coordinates              +-----------------+  - V=1

    An identity CylinderPoseCenter places the center of the cylinder at the recentered origin unless the headlocked flag is set.

    Does not utilize HmdSpaceToWorldScaleInMeters. If necessary, adjust translation and radius.

    Note

    Only the interior surface of the cylinder is visible. Use cylinder layers when the user cannot leave the extents of the cylinder. Artifacts may appear when viewing the cylinder's exterior surface. Additionally, while the interface supports an Angle that ranges from [0,2*Pi] the angle should remain less than 1.9*PI to avoid artifacts where the cylinder edges converge.

    Layout

    
     struct ovrLayerCylinder {
         ovrLayerHeader Header();
         ovrTextureSwapChain ColorTexture();
         ovrRecti Viewport();
         ovrPosef CylinderPoseCenter();
         float CylinderRadius();
         float CylinderAngle();
         float CylinderAspectRatio();
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • HEADER, COLORTEXTURE, VIEWPORT, CYLINDERPOSECENTER, CYLINDERRADIUS, CYLINDERANGLE, CYLINDERASPECTRATIO

        The struct member offsets.
    • Constructor Detail

      • OVRLayerCylinder

        public OVRLayerCylinder​(java.nio.ByteBuffer container)
        Creates a OVRLayerCylinder 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()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • ColorTexture

        public long ColorTexture()
        contains a single image, never with any stereo view
      • Viewport

        public OVRRecti Viewport()
        specifies the ColorTexture sub-rect UV coordinates
      • CylinderPoseCenter

        public OVRPosef CylinderPoseCenter()
        specifies the orientation and position of the center point of a cylinder layer type. The position is in real-world meters not the application's virtual world, but the physical world the user is in. It is relative to the "zero" position set by RecenterTrackingOrigin unless the LayerFlag_HeadLocked flag is used.
      • CylinderRadius

        public float CylinderRadius()
        radius of the cylinder in meters
      • CylinderAngle

        public float CylinderAngle()
        angle in radians. Range is from 0 to 2*Pi exclusive covering the entire cylinder (see diagram and note above).
      • CylinderAspectRatio

        public float CylinderAspectRatio()
        custom aspect ratio presumably set based on Viewport. Used to calculate the height of the cylinder based on the arc-length (CylinderAngle) and radius (CylinderRadius) given above. The height of the cylinder is given by: height = (CylinderRadius * CylinderAngle) / CylinderAspectRatio. Aspect ratio is width / height.
      • set

        public OVRLayerCylinder set​(OVRLayerHeader Header,
                                    long ColorTexture,
                                    OVRRecti Viewport,
                                    OVRPosef CylinderPoseCenter,
                                    float CylinderRadius,
                                    float CylinderAngle,
                                    float CylinderAspectRatio)
        Initializes this struct with the specified values.
      • set

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

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

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

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

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

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

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

        @Deprecated
        public static OVRLayerCylinder mallocStack​(org.lwjgl.system.MemoryStack stack)
        Deprecated.
        Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
      • callocStack

        @Deprecated
        public static OVRLayerCylinder callocStack​(org.lwjgl.system.MemoryStack stack)
        Deprecated.
        Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
      • malloc

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

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

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

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

        public static long nColorTexture​(long struct)
        Unsafe version of ColorTexture().
      • nViewport

        public static OVRRecti nViewport​(long struct)
        Unsafe version of Viewport().
      • nCylinderRadius

        public static float nCylinderRadius​(long struct)
        Unsafe version of CylinderRadius().
      • nCylinderAngle

        public static float nCylinderAngle​(long struct)
        Unsafe version of CylinderAngle().
      • nCylinderAspectRatio

        public static float nCylinderAspectRatio​(long struct)
        Unsafe version of CylinderAspectRatio().
      • nHeader

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

        public static void nColorTexture​(long struct,
                                         long value)
        Unsafe version of ColorTexture.
      • nViewport

        public static void nViewport​(long struct,
                                     OVRRecti value)
        Unsafe version of Viewport.
      • nCylinderPoseCenter

        public static void nCylinderPoseCenter​(long struct,
                                               OVRPosef value)
        Unsafe version of CylinderPoseCenter.
      • nCylinderRadius

        public static void nCylinderRadius​(long struct,
                                           float value)
        Unsafe version of CylinderRadius.
      • nCylinderAngle

        public static void nCylinderAngle​(long struct,
                                          float value)
        Unsafe version of CylinderAngle.
      • nCylinderAspectRatio

        public static void nCylinderAspectRatio​(long struct,
                                                float value)
        Unsafe version of CylinderAspectRatio.
      • validate

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