Package org.lwjgl.ovr

Class OVRLayerCylinder

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

public class OVRLayerCylinder extends org.lwjgl.system.Struct<OVRLayerCylinder> 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 Details

    • SIZEOF

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

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

      public static final int COLORTEXTURE
      The struct member offsets.
    • VIEWPORT

      public static final int VIEWPORT
      The struct member offsets.
    • CYLINDERPOSECENTER

      public static final int CYLINDERPOSECENTER
      The struct member offsets.
    • CYLINDERRADIUS

      public static final int CYLINDERRADIUS
      The struct member offsets.
    • CYLINDERANGLE

      public static final int CYLINDERANGLE
      The struct member offsets.
    • CYLINDERASPECTRATIO

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

    • OVRLayerCylinder

      public OVRLayerCylinder(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 Details

    • sizeof

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

      public OVRLayerHeader Header()
      Header.Type must be LayerType_Cylinder
    • 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.
    • Header

      public OVRLayerCylinder Header(OVRLayerHeader value)
      Copies the specified OVRLayerHeader to the Header() field.
    • Header

      public OVRLayerCylinder Header(Consumer<OVRLayerHeader> consumer)
      Passes the Header() field to the specified Consumer.
    • ColorTexture

      public OVRLayerCylinder ColorTexture(long value)
      Sets the specified value to the ColorTexture() field.
    • Viewport

      public OVRLayerCylinder Viewport(OVRRecti value)
      Copies the specified OVRRecti to the Viewport() field.
    • Viewport

      public OVRLayerCylinder Viewport(Consumer<OVRRecti> consumer)
      Passes the Viewport() field to the specified Consumer.
    • CylinderPoseCenter

      public OVRLayerCylinder CylinderPoseCenter(OVRPosef value)
      Copies the specified OVRPosef to the CylinderPoseCenter() field.
    • CylinderPoseCenter

      public OVRLayerCylinder CylinderPoseCenter(Consumer<OVRPosef> consumer)
      Passes the CylinderPoseCenter() field to the specified Consumer.
    • CylinderRadius

      public OVRLayerCylinder CylinderRadius(float value)
      Sets the specified value to the CylinderRadius() field.
    • CylinderAngle

      public OVRLayerCylinder CylinderAngle(float value)
      Sets the specified value to the CylinderAngle() field.
    • CylinderAspectRatio

      public OVRLayerCylinder CylinderAspectRatio(float value)
      Sets the specified value to the CylinderAspectRatio() field.
    • 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

      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

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

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

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

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

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

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

      @Deprecated public static OVRLayerCylinder mallocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static OVRLayerCylinder callocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • 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.
    • mallocStack

      @Deprecated public static OVRLayerCylinder.Buffer mallocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static OVRLayerCylinder.Buffer callocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • mallocStack

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

      @Deprecated public static OVRLayerCylinder.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, 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:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • 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:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • nHeader

      public static OVRLayerHeader nHeader(long struct)
      Unsafe version of Header().
    • nColorTexture

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

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

      public static OVRPosef nCylinderPoseCenter(long struct)
      Unsafe version of CylinderPoseCenter().
    • 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