Package org.lwjgl.ovr
Class OVRLayerCylinder
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.ovr.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.NativeResourceDescribes a layer of typeLayerType_Cylinderwhich 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=1An identity
CylinderPoseCenterplaces 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 than1.9*PIto avoid artifacts where the cylinder edges converge.Layout
struct ovrLayerCylinder {ovrLayerHeaderHeader(); ovrTextureSwapChainColorTexture();ovrRectiViewport();ovrPosefCylinderPoseCenter(); floatCylinderRadius(); floatCylinderAngle(); floatCylinderAspectRatio(); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOVRLayerCylinder.BufferAn array ofOVRLayerCylinderstructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intCOLORTEXTURE
CYLINDERANGLE
CYLINDERASPECTRATIO
CYLINDERPOSECENTER
CYLINDERRADIUS
HEADERThe struct member offsets.static intSIZEOFThe struct size in bytes.static intVIEWPORTThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description OVRLayerCylinder(java.nio.ByteBuffer container)Creates aOVRLayerCylinderinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static OVRLayerCylindercalloc()Returns a newOVRLayerCylinderinstance allocated withmemCalloc.static OVRLayerCylinder.Buffercalloc(int capacity)Returns a newOVRLayerCylinder.Bufferinstance allocated withmemCalloc.static OVRLayerCylinder.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newOVRLayerCylinder.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static OVRLayerCylindercalloc(org.lwjgl.system.MemoryStack stack)Returns a newOVRLayerCylinderinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static OVRLayerCylindercallocStack()Deprecated.static OVRLayerCylinder.BuffercallocStack(int capacity)Deprecated.static OVRLayerCylinder.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static OVRLayerCylindercallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.longColorTexture()contains a single image, never with any stereo viewOVRLayerCylinderColorTexture(long value)Sets the specified value to theColorTexture()field.static OVRLayerCylindercreate()Returns a newOVRLayerCylinderinstance allocated withBufferUtils.static OVRLayerCylinder.Buffercreate(int capacity)Returns a newOVRLayerCylinder.Bufferinstance allocated withBufferUtils.static OVRLayerCylindercreate(long address)Returns a newOVRLayerCylinderinstance for the specified memory address.static OVRLayerCylinder.Buffercreate(long address, int capacity)Create aOVRLayerCylinder.Bufferinstance at the specified memory.static OVRLayerCylindercreateSafe(long address)static OVRLayerCylinder.BuffercreateSafe(long address, int capacity)floatCylinderAngle()angle in radians.OVRLayerCylinderCylinderAngle(float value)Sets the specified value to theCylinderAngle()field.floatCylinderAspectRatio()custom aspect ratio presumably set based onViewport.OVRLayerCylinderCylinderAspectRatio(float value)Sets the specified value to theCylinderAspectRatio()field.OVRPosefCylinderPoseCenter()specifies the orientation and position of the center point of a cylinder layer type.OVRLayerCylinderCylinderPoseCenter(java.util.function.Consumer<OVRPosef> consumer)Passes theCylinderPoseCenter()field to the specifiedConsumer.OVRLayerCylinderCylinderPoseCenter(OVRPosef value)Copies the specifiedOVRPosefto theCylinderPoseCenter()field.floatCylinderRadius()radius of the cylinder in metersOVRLayerCylinderCylinderRadius(float value)Sets the specified value to theCylinderRadius()field.OVRLayerHeaderHeader()Header.Typemust beLayerType_CylinderOVRLayerCylinderHeader(java.util.function.Consumer<OVRLayerHeader> consumer)Passes theHeader()field to the specifiedConsumer.OVRLayerCylinderHeader(OVRLayerHeader value)Copies the specifiedOVRLayerHeaderto theHeader()field.static OVRLayerCylindermalloc()Returns a newOVRLayerCylinderinstance allocated withmemAlloc.static OVRLayerCylinder.Buffermalloc(int capacity)Returns a newOVRLayerCylinder.Bufferinstance allocated withmemAlloc.static OVRLayerCylinder.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newOVRLayerCylinder.Bufferinstance allocated on the specifiedMemoryStack.static OVRLayerCylindermalloc(org.lwjgl.system.MemoryStack stack)Returns a newOVRLayerCylinderinstance allocated on the specifiedMemoryStack.static OVRLayerCylindermallocStack()Deprecated.static OVRLayerCylinder.BuffermallocStack(int capacity)Deprecated.static OVRLayerCylinder.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static OVRLayerCylindermallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.static longnColorTexture(long struct)Unsafe version ofColorTexture().static voidnColorTexture(long struct, long value)Unsafe version ofColorTexture.static floatnCylinderAngle(long struct)Unsafe version ofCylinderAngle().static voidnCylinderAngle(long struct, float value)Unsafe version ofCylinderAngle.static floatnCylinderAspectRatio(long struct)Unsafe version ofCylinderAspectRatio().static voidnCylinderAspectRatio(long struct, float value)Unsafe version ofCylinderAspectRatio.static OVRPosefnCylinderPoseCenter(long struct)Unsafe version ofCylinderPoseCenter().static voidnCylinderPoseCenter(long struct, OVRPosef value)Unsafe version ofCylinderPoseCenter.static floatnCylinderRadius(long struct)Unsafe version ofCylinderRadius().static voidnCylinderRadius(long struct, float value)Unsafe version ofCylinderRadius.static OVRLayerHeadernHeader(long struct)Unsafe version ofHeader().static voidnHeader(long struct, OVRLayerHeader value)Unsafe version ofHeader.static OVRRectinViewport(long struct)Unsafe version ofViewport().static voidnViewport(long struct, OVRRecti value)Unsafe version ofViewport.OVRLayerCylinderset(OVRLayerCylinder src)Copies the specified struct data to this struct.OVRLayerCylinderset(OVRLayerHeader Header, long ColorTexture, OVRRecti Viewport, OVRPosef CylinderPoseCenter, float CylinderRadius, float CylinderAngle, float CylinderAspectRatio)Initializes this struct with the specified values.intsizeof()static voidvalidate(long struct)Validates pointer members that should not beNULL.OVRRectiViewport()specifies the ColorTexture sub-rect UV coordinatesOVRLayerCylinderViewport(java.util.function.Consumer<OVRRecti> consumer)Passes theViewport()field to the specifiedConsumer.OVRLayerCylinderViewport(OVRRecti value)Copies the specifiedOVRRectito theViewport()field.
-
-
-
Constructor Detail
-
OVRLayerCylinder
public OVRLayerCylinder(java.nio.ByteBuffer container)
Creates aOVRLayerCylinderinstance at the current position of the specifiedByteBuffercontainer. 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:
sizeofin classorg.lwjgl.system.Struct
-
Header
public OVRLayerHeader Header()
Header.Typemust beLayerType_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 byRecenterTrackingOriginunless theLayerFlag_HeadLockedflag is used.
-
CylinderRadius
public float CylinderRadius()
radius of the cylinder in meters
-
CylinderAngle
public float CylinderAngle()
angle in radians. Range is from 0 to2*Piexclusive covering the entire cylinder (see diagram and note above).
-
CylinderAspectRatio
public float CylinderAspectRatio()
custom aspect ratio presumably set based onViewport. 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 iswidth / height.
-
Header
public OVRLayerCylinder Header(OVRLayerHeader value)
Copies the specifiedOVRLayerHeaderto theHeader()field.
-
Header
public OVRLayerCylinder Header(java.util.function.Consumer<OVRLayerHeader> consumer)
Passes theHeader()field to the specifiedConsumer.
-
ColorTexture
public OVRLayerCylinder ColorTexture(long value)
Sets the specified value to theColorTexture()field.
-
Viewport
public OVRLayerCylinder Viewport(OVRRecti value)
Copies the specifiedOVRRectito theViewport()field.
-
Viewport
public OVRLayerCylinder Viewport(java.util.function.Consumer<OVRRecti> consumer)
Passes theViewport()field to the specifiedConsumer.
-
CylinderPoseCenter
public OVRLayerCylinder CylinderPoseCenter(OVRPosef value)
Copies the specifiedOVRPosefto theCylinderPoseCenter()field.
-
CylinderPoseCenter
public OVRLayerCylinder CylinderPoseCenter(java.util.function.Consumer<OVRPosef> consumer)
Passes theCylinderPoseCenter()field to the specifiedConsumer.
-
CylinderRadius
public OVRLayerCylinder CylinderRadius(float value)
Sets the specified value to theCylinderRadius()field.
-
CylinderAngle
public OVRLayerCylinder CylinderAngle(float value)
Sets the specified value to theCylinderAngle()field.
-
CylinderAspectRatio
public OVRLayerCylinder CylinderAspectRatio(float value)
Sets the specified value to theCylinderAspectRatio()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
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 newOVRLayerCylinderinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static OVRLayerCylinder calloc()
Returns a newOVRLayerCylinderinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static OVRLayerCylinder create()
Returns a newOVRLayerCylinderinstance allocated withBufferUtils.
-
create
public static OVRLayerCylinder create(long address)
Returns a newOVRLayerCylinderinstance for the specified memory address.
-
createSafe
@Nullable public static OVRLayerCylinder createSafe(long address)
-
malloc
public static OVRLayerCylinder.Buffer malloc(int capacity)
Returns a newOVRLayerCylinder.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static OVRLayerCylinder.Buffer calloc(int capacity)
Returns a newOVRLayerCylinder.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static OVRLayerCylinder.Buffer create(int capacity)
Returns a newOVRLayerCylinder.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static OVRLayerCylinder.Buffer create(long address, int capacity)
Create aOVRLayerCylinder.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static OVRLayerCylinder.Buffer createSafe(long address, int capacity)
-
mallocStack
@Deprecated public static OVRLayerCylinder mallocStack()
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static OVRLayerCylinder callocStack()
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static OVRLayerCylinder mallocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static OVRLayerCylinder callocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static OVRLayerCylinder.Buffer mallocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static OVRLayerCylinder.Buffer callocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(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. Usemalloc(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. Usecalloc(int, MemoryStack)instead.
-
malloc
public static OVRLayerCylinder malloc(org.lwjgl.system.MemoryStack stack)
Returns a newOVRLayerCylinderinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static OVRLayerCylinder calloc(org.lwjgl.system.MemoryStack stack)
Returns a newOVRLayerCylinderinstance allocated on the specifiedMemoryStackand 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 newOVRLayerCylinder.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static OVRLayerCylinder.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOVRLayerCylinder.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nHeader
public static OVRLayerHeader nHeader(long struct)
Unsafe version ofHeader().
-
nColorTexture
public static long nColorTexture(long struct)
Unsafe version ofColorTexture().
-
nViewport
public static OVRRecti nViewport(long struct)
Unsafe version ofViewport().
-
nCylinderPoseCenter
public static OVRPosef nCylinderPoseCenter(long struct)
Unsafe version ofCylinderPoseCenter().
-
nCylinderRadius
public static float nCylinderRadius(long struct)
Unsafe version ofCylinderRadius().
-
nCylinderAngle
public static float nCylinderAngle(long struct)
Unsafe version ofCylinderAngle().
-
nCylinderAspectRatio
public static float nCylinderAspectRatio(long struct)
Unsafe version ofCylinderAspectRatio().
-
nHeader
public static void nHeader(long struct, OVRLayerHeader value)Unsafe version ofHeader.
-
nColorTexture
public static void nColorTexture(long struct, long value)Unsafe version ofColorTexture.
-
nCylinderPoseCenter
public static void nCylinderPoseCenter(long struct, OVRPosef value)Unsafe version ofCylinderPoseCenter.
-
nCylinderRadius
public static void nCylinderRadius(long struct, float value)Unsafe version ofCylinderRadius.
-
nCylinderAngle
public static void nCylinderAngle(long struct, float value)Unsafe version ofCylinderAngle.
-
nCylinderAspectRatio
public static void nCylinderAspectRatio(long struct, float value)Unsafe version ofCylinderAspectRatio.
-
validate
public static void validate(long struct)
Validates pointer members that should not beNULL.- Parameters:
struct- the struct to validate
-
-