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.Member documentation
Header–Header.Typemust beLayerType_CylinderColorTexture– contains a single image, never with any stereo viewViewport– specifies the ColorTexture sub-rect UV coordinatesCylinderPoseCenter– 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– radius of the cylinder in metersCylinderAngle– angle in radians. Range is from 0 to2*Piexclusive covering the entire cylinder (see diagram and note above).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.
Layout
struct ovrLayerCylinder {ovrLayerHeaderHeader; ovrTextureSwapChain ColorTexture;ovrRectiViewport;ovrPosefCylinderPoseCenter; float CylinderRadius; float CylinderAngle; float CylinderAspectRatio; }
-
-
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 Modifier and Type Method Description static OVRLayerCylindercalloc()Returns a newOVRLayerCylinderinstance allocated withmemCalloc.static OVRLayerCylinder.Buffercalloc(int capacity)Returns a newOVRLayerCylinder.Bufferinstance allocated withmemCalloc.static OVRLayerCylindercallocStack()Returns a newOVRLayerCylinderinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static OVRLayerCylinder.BuffercallocStack(int capacity)Returns a newOVRLayerCylinder.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static OVRLayerCylinder.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newOVRLayerCylinder.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static OVRLayerCylindercallocStack(org.lwjgl.system.MemoryStack stack)Returns a newOVRLayerCylinderinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.longColorTexture()Returns the value of theColorTexturefield.OVRLayerCylinderColorTexture(long value)Sets the specified value to theColorTexturefield.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()Returns the value of theCylinderAnglefield.OVRLayerCylinderCylinderAngle(float value)Sets the specified value to theCylinderAnglefield.floatCylinderAspectRatio()Returns the value of theCylinderAspectRatiofield.OVRLayerCylinderCylinderAspectRatio(float value)Sets the specified value to theCylinderAspectRatiofield.OVRPosefCylinderPoseCenter()Returns aOVRPosefview of theCylinderPoseCenterfield.OVRLayerCylinderCylinderPoseCenter(java.util.function.Consumer<OVRPosef> consumer)Passes theCylinderPoseCenterfield to the specifiedConsumer.OVRLayerCylinderCylinderPoseCenter(OVRPosef value)Copies the specifiedOVRPosefto theCylinderPoseCenterfield.floatCylinderRadius()Returns the value of theCylinderRadiusfield.OVRLayerCylinderCylinderRadius(float value)Sets the specified value to theCylinderRadiusfield.OVRLayerHeaderHeader()Returns aOVRLayerHeaderview of theHeaderfield.OVRLayerCylinderHeader(java.util.function.Consumer<OVRLayerHeader> consumer)Passes theHeaderfield to the specifiedConsumer.OVRLayerCylinderHeader(OVRLayerHeader value)Copies the specifiedOVRLayerHeaderto theHeaderfield.static OVRLayerCylindermalloc()Returns a newOVRLayerCylinderinstance allocated withmemAlloc.static OVRLayerCylinder.Buffermalloc(int capacity)Returns a newOVRLayerCylinder.Bufferinstance allocated withmemAlloc.static OVRLayerCylindermallocStack()Returns a newOVRLayerCylinderinstance allocated on the thread-localMemoryStack.static OVRLayerCylinder.BuffermallocStack(int capacity)Returns a newOVRLayerCylinder.Bufferinstance allocated on the thread-localMemoryStack.static OVRLayerCylinder.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newOVRLayerCylinder.Bufferinstance allocated on the specifiedMemoryStack.static OVRLayerCylindermallocStack(org.lwjgl.system.MemoryStack stack)Returns a newOVRLayerCylinderinstance allocated on the specifiedMemoryStack.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.static voidvalidate(long array, int count)Callsvalidate(long)for each struct contained in the specified struct array.OVRRectiViewport()Returns aOVRRectiview of theViewportfield.OVRLayerCylinderViewport(java.util.function.Consumer<OVRRecti> consumer)Passes theViewportfield to the specifiedConsumer.OVRLayerCylinderViewport(OVRRecti value)Copies the specifiedOVRRectito theViewportfield.
-
-
-
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()
Returns aOVRLayerHeaderview of theHeaderfield.
-
ColorTexture
public long ColorTexture()
Returns the value of theColorTexturefield.
-
CylinderPoseCenter
public OVRPosef CylinderPoseCenter()
Returns aOVRPosefview of theCylinderPoseCenterfield.
-
CylinderRadius
public float CylinderRadius()
Returns the value of theCylinderRadiusfield.
-
CylinderAngle
public float CylinderAngle()
Returns the value of theCylinderAnglefield.
-
CylinderAspectRatio
public float CylinderAspectRatio()
Returns the value of theCylinderAspectRatiofield.
-
Header
public OVRLayerCylinder Header(OVRLayerHeader value)
Copies the specifiedOVRLayerHeaderto theHeaderfield.
-
Header
public OVRLayerCylinder Header(java.util.function.Consumer<OVRLayerHeader> consumer)
Passes theHeaderfield to the specifiedConsumer.
-
ColorTexture
public OVRLayerCylinder ColorTexture(long value)
Sets the specified value to theColorTexturefield.
-
Viewport
public OVRLayerCylinder Viewport(OVRRecti value)
Copies the specifiedOVRRectito theViewportfield.
-
Viewport
public OVRLayerCylinder Viewport(java.util.function.Consumer<OVRRecti> consumer)
Passes theViewportfield to the specifiedConsumer.
-
CylinderPoseCenter
public OVRLayerCylinder CylinderPoseCenter(OVRPosef value)
Copies the specifiedOVRPosefto theCylinderPoseCenterfield.
-
CylinderPoseCenter
public OVRLayerCylinder CylinderPoseCenter(java.util.function.Consumer<OVRPosef> consumer)
Passes theCylinderPoseCenterfield to the specifiedConsumer.
-
CylinderRadius
public OVRLayerCylinder CylinderRadius(float value)
Sets the specified value to theCylinderRadiusfield.
-
CylinderAngle
public OVRLayerCylinder CylinderAngle(float value)
Sets the specified value to theCylinderAnglefield.
-
CylinderAspectRatio
public OVRLayerCylinder CylinderAspectRatio(float value)
Sets the specified value to theCylinderAspectRatiofield.
-
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
public static OVRLayerCylinder mallocStack()
Returns a newOVRLayerCylinderinstance allocated on the thread-localMemoryStack.
-
callocStack
public static OVRLayerCylinder callocStack()
Returns a newOVRLayerCylinderinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static OVRLayerCylinder mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRLayerCylinderinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static OVRLayerCylinder callocStack(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
-
mallocStack
public static OVRLayerCylinder.Buffer mallocStack(int capacity)
Returns a newOVRLayerCylinder.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static OVRLayerCylinder.Buffer callocStack(int capacity)
Returns a newOVRLayerCylinder.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacity
-
mallocStack
public static OVRLayerCylinder.Buffer mallocStack(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
-
callocStack
public static OVRLayerCylinder.Buffer callocStack(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
-
validate
public static void validate(long array, int count)Callsvalidate(long)for each struct contained in the specified struct array.- Parameters:
array- the struct array to validatecount- the number of structs inarray
-
-