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.NativeResource
Describes a layer of typeLayerType_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 than1.9*PI
to avoid artifacts where the cylinder edges converge.Member documentation
Header
–Header.Type
must beLayerType_Cylinder
ColorTexture
– 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 byRecenterTrackingOrigin
unless theLayerFlag_HeadLocked
flag is used.CylinderRadius
– radius of the cylinder in metersCylinderAngle
– angle in radians. Range is from 0 to2*Pi
exclusive 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 {
ovrLayerHeader
Header; ovrTextureSwapChain ColorTexture;ovrRecti
Viewport;ovrPosef
CylinderPoseCenter; float CylinderRadius; float CylinderAngle; float CylinderAspectRatio; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OVRLayerCylinder.Buffer
An array ofOVRLayerCylinder
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
COLORTEXTURE
CYLINDERANGLE
CYLINDERASPECTRATIO
CYLINDERPOSECENTER
CYLINDERRADIUS
HEADERThe struct member offsets.static int
SIZEOF
The struct size in bytes.static int
VIEWPORT
The struct member offsets.
-
Constructor Summary
Constructors Constructor Description OVRLayerCylinder(java.nio.ByteBuffer container)
Creates aOVRLayerCylinder
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OVRLayerCylinder
calloc()
Returns a newOVRLayerCylinder
instance allocated withmemCalloc
.static OVRLayerCylinder.Buffer
calloc(int capacity)
Returns a newOVRLayerCylinder.Buffer
instance allocated withmemCalloc
.static OVRLayerCylinder
callocStack()
Returns a newOVRLayerCylinder
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static OVRLayerCylinder.Buffer
callocStack(int capacity)
Returns a newOVRLayerCylinder.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static OVRLayerCylinder.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOVRLayerCylinder.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static OVRLayerCylinder
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRLayerCylinder
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.long
ColorTexture()
Returns the value of theColorTexture
field.OVRLayerCylinder
ColorTexture(long value)
Sets the specified value to theColorTexture
field.static OVRLayerCylinder
create()
Returns a newOVRLayerCylinder
instance allocated withBufferUtils
.static OVRLayerCylinder.Buffer
create(int capacity)
Returns a newOVRLayerCylinder.Buffer
instance allocated withBufferUtils
.static OVRLayerCylinder
create(long address)
Returns a newOVRLayerCylinder
instance for the specified memory address.static OVRLayerCylinder.Buffer
create(long address, int capacity)
Create aOVRLayerCylinder.Buffer
instance at the specified memory.static OVRLayerCylinder
createSafe(long address)
static OVRLayerCylinder.Buffer
createSafe(long address, int capacity)
float
CylinderAngle()
Returns the value of theCylinderAngle
field.OVRLayerCylinder
CylinderAngle(float value)
Sets the specified value to theCylinderAngle
field.float
CylinderAspectRatio()
Returns the value of theCylinderAspectRatio
field.OVRLayerCylinder
CylinderAspectRatio(float value)
Sets the specified value to theCylinderAspectRatio
field.OVRPosef
CylinderPoseCenter()
Returns aOVRPosef
view of theCylinderPoseCenter
field.OVRLayerCylinder
CylinderPoseCenter(java.util.function.Consumer<OVRPosef> consumer)
Passes theCylinderPoseCenter
field to the specifiedConsumer
.OVRLayerCylinder
CylinderPoseCenter(OVRPosef value)
Copies the specifiedOVRPosef
to theCylinderPoseCenter
field.float
CylinderRadius()
Returns the value of theCylinderRadius
field.OVRLayerCylinder
CylinderRadius(float value)
Sets the specified value to theCylinderRadius
field.OVRLayerHeader
Header()
Returns aOVRLayerHeader
view of theHeader
field.OVRLayerCylinder
Header(java.util.function.Consumer<OVRLayerHeader> consumer)
Passes theHeader
field to the specifiedConsumer
.OVRLayerCylinder
Header(OVRLayerHeader value)
Copies the specifiedOVRLayerHeader
to theHeader
field.static OVRLayerCylinder
malloc()
Returns a newOVRLayerCylinder
instance allocated withmemAlloc
.static OVRLayerCylinder.Buffer
malloc(int capacity)
Returns a newOVRLayerCylinder.Buffer
instance allocated withmemAlloc
.static OVRLayerCylinder
mallocStack()
Returns a newOVRLayerCylinder
instance allocated on the thread-localMemoryStack
.static OVRLayerCylinder.Buffer
mallocStack(int capacity)
Returns a newOVRLayerCylinder.Buffer
instance allocated on the thread-localMemoryStack
.static OVRLayerCylinder.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOVRLayerCylinder.Buffer
instance allocated on the specifiedMemoryStack
.static OVRLayerCylinder
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRLayerCylinder
instance allocated on the specifiedMemoryStack
.static long
nColorTexture(long struct)
Unsafe version ofColorTexture()
.static void
nColorTexture(long struct, long value)
Unsafe version ofColorTexture
.static float
nCylinderAngle(long struct)
Unsafe version ofCylinderAngle()
.static void
nCylinderAngle(long struct, float value)
Unsafe version ofCylinderAngle
.static float
nCylinderAspectRatio(long struct)
Unsafe version ofCylinderAspectRatio()
.static void
nCylinderAspectRatio(long struct, float value)
Unsafe version ofCylinderAspectRatio
.static OVRPosef
nCylinderPoseCenter(long struct)
Unsafe version ofCylinderPoseCenter()
.static void
nCylinderPoseCenter(long struct, OVRPosef value)
Unsafe version ofCylinderPoseCenter
.static float
nCylinderRadius(long struct)
Unsafe version ofCylinderRadius()
.static void
nCylinderRadius(long struct, float value)
Unsafe version ofCylinderRadius
.static OVRLayerHeader
nHeader(long struct)
Unsafe version ofHeader()
.static void
nHeader(long struct, OVRLayerHeader value)
Unsafe version ofHeader
.static OVRRecti
nViewport(long struct)
Unsafe version ofViewport()
.static void
nViewport(long struct, OVRRecti value)
Unsafe version ofViewport
.OVRLayerCylinder
set(OVRLayerCylinder src)
Copies the specified struct data to this struct.OVRLayerCylinder
set(OVRLayerHeader Header, long ColorTexture, OVRRecti Viewport, OVRPosef CylinderPoseCenter, float CylinderRadius, float CylinderAngle, float CylinderAspectRatio)
Initializes this struct with the specified values.int
sizeof()
static void
validate(long struct)
Validates pointer members that should not beNULL
.static void
validate(long array, int count)
Callsvalidate(long)
for each struct contained in the specified struct array.OVRRecti
Viewport()
Returns aOVRRecti
view of theViewport
field.OVRLayerCylinder
Viewport(java.util.function.Consumer<OVRRecti> consumer)
Passes theViewport
field to the specifiedConsumer
.OVRLayerCylinder
Viewport(OVRRecti value)
Copies the specifiedOVRRecti
to theViewport
field.
-
-
-
Constructor Detail
-
OVRLayerCylinder
public OVRLayerCylinder(java.nio.ByteBuffer container)
Creates aOVRLayerCylinder
instance at the current position of the specifiedByteBuffer
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 classorg.lwjgl.system.Struct
-
Header
public OVRLayerHeader Header()
Returns aOVRLayerHeader
view of theHeader
field.
-
ColorTexture
public long ColorTexture()
Returns the value of theColorTexture
field.
-
CylinderPoseCenter
public OVRPosef CylinderPoseCenter()
Returns aOVRPosef
view of theCylinderPoseCenter
field.
-
CylinderRadius
public float CylinderRadius()
Returns the value of theCylinderRadius
field.
-
CylinderAngle
public float CylinderAngle()
Returns the value of theCylinderAngle
field.
-
CylinderAspectRatio
public float CylinderAspectRatio()
Returns the value of theCylinderAspectRatio
field.
-
Header
public OVRLayerCylinder Header(OVRLayerHeader value)
Copies the specifiedOVRLayerHeader
to 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 specifiedOVRRecti
to 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 specifiedOVRPosef
to 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 newOVRLayerCylinder
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static OVRLayerCylinder calloc()
Returns a newOVRLayerCylinder
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static OVRLayerCylinder create()
Returns a newOVRLayerCylinder
instance allocated withBufferUtils
.
-
create
public static OVRLayerCylinder create(long address)
Returns a newOVRLayerCylinder
instance for the specified memory address.
-
createSafe
@Nullable public static OVRLayerCylinder createSafe(long address)
-
malloc
public static OVRLayerCylinder.Buffer malloc(int capacity)
Returns a newOVRLayerCylinder.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static OVRLayerCylinder.Buffer calloc(int capacity)
Returns a newOVRLayerCylinder.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static OVRLayerCylinder.Buffer create(int capacity)
Returns a newOVRLayerCylinder.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static OVRLayerCylinder.Buffer create(long address, int capacity)
Create aOVRLayerCylinder.Buffer
instance 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 newOVRLayerCylinder
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static OVRLayerCylinder callocStack()
Returns a newOVRLayerCylinder
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static OVRLayerCylinder mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRLayerCylinder
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static OVRLayerCylinder callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRLayerCylinder
instance allocated on the specifiedMemoryStack
and 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.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static OVRLayerCylinder.Buffer callocStack(int capacity)
Returns a newOVRLayerCylinder.Buffer
instance allocated on the thread-localMemoryStack
and 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.Buffer
instance 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.Buffer
instance allocated on the specifiedMemoryStack
and 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
-
-