Package org.lwjgl.ovr
Class OVRLayerCylinder
- All Implemented Interfaces:
AutoCloseable
,NativeResource
,Pointer
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()
;
}
-
Nested Class Summary
Nested classes/interfaces inherited from class org.lwjgl.system.Struct
Struct.StructValidation
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The struct alignment in bytes.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct size in bytes.static final int
The struct member offsets.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
-
Constructor Summary
ConstructorDescriptionOVRLayerCylinder
(ByteBuffer container) Creates aOVRLayerCylinder
instance at the current position of the specifiedByteBuffer
container. -
Method Summary
Modifier and TypeMethodDescriptionstatic OVRLayerCylinder
calloc()
Returns a newOVRLayerCylinder
instance allocated withmemCalloc
.static OVRLayerCylinder.Buffer
calloc
(int capacity) Returns a newOVRLayerCylinder.Buffer
instance allocated withmemCalloc
.static OVRLayerCylinder.Buffer
calloc
(int capacity, MemoryStack stack) Returns a newOVRLayerCylinder.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static OVRLayerCylinder
calloc
(MemoryStack stack) Returns a newOVRLayerCylinder
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static OVRLayerCylinder
Deprecated.static OVRLayerCylinder.Buffer
callocStack
(int capacity) Deprecated.static OVRLayerCylinder.Buffer
callocStack
(int capacity, MemoryStack stack) Deprecated.static OVRLayerCylinder
callocStack
(MemoryStack stack) Deprecated.long
contains a single image, never with any stereo viewColorTexture
(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
angle in radians.CylinderAngle
(float value) Sets the specified value to theCylinderAngle()
field.float
custom aspect ratio presumably set based onViewport
.CylinderAspectRatio
(float value) Sets the specified value to theCylinderAspectRatio()
field.specifies the orientation and position of the center point of a cylinder layer type.CylinderPoseCenter
(Consumer<OVRPosef> consumer) Passes theCylinderPoseCenter()
field to the specifiedConsumer
.CylinderPoseCenter
(OVRPosef value) Copies the specifiedOVRPosef
to theCylinderPoseCenter()
field.float
radius of the cylinder in metersCylinderRadius
(float value) Sets the specified value to theCylinderRadius()
field.Header()
Header.Type
must beLayerType_Cylinder
Header
(Consumer<OVRLayerHeader> consumer) 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.Buffer
malloc
(int capacity, MemoryStack stack) Returns a newOVRLayerCylinder.Buffer
instance allocated on the specifiedMemoryStack
.static OVRLayerCylinder
malloc
(MemoryStack stack) Returns a newOVRLayerCylinder
instance allocated on the specifiedMemoryStack
.static OVRLayerCylinder
Deprecated.static OVRLayerCylinder.Buffer
mallocStack
(int capacity) Deprecated.static OVRLayerCylinder.Buffer
mallocStack
(int capacity, MemoryStack stack) Deprecated.static OVRLayerCylinder
mallocStack
(MemoryStack stack) Deprecated.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
Unsafe version ofViewport
.set
(OVRLayerCylinder src) Copies the specified struct data to this struct.set
(OVRLayerHeader Header, long ColorTexture, OVRRecti Viewport, OVRPosef CylinderPoseCenter, float CylinderRadius, float CylinderAngle, float CylinderAspectRatio) Initializes this struct with the specified values.int
sizeof()
Returnssizeof(struct)
.static void
validate
(long struct) Validates pointer members that should not beNULL
.Viewport()
specifies the ColorTexture sub-rect UV coordinatesPasses theViewport()
field to the specifiedConsumer
.Copies the specifiedOVRRecti
to theViewport()
field.Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toString
Methods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Field Details
-
SIZEOF
public static final int SIZEOFThe struct size in bytes. -
ALIGNOF
public static final int ALIGNOFThe struct alignment in bytes. -
HEADER
public static final int HEADERThe struct member offsets. -
COLORTEXTURE
public static final int COLORTEXTUREThe struct member offsets. -
VIEWPORT
public static final int VIEWPORTThe struct member offsets. -
CYLINDERPOSECENTER
public static final int CYLINDERPOSECENTERThe struct member offsets. -
CYLINDERRADIUS
public static final int CYLINDERRADIUSThe struct member offsets. -
CYLINDERANGLE
public static final int CYLINDERANGLEThe struct member offsets. -
CYLINDERASPECTRATIO
public static final int CYLINDERASPECTRATIOThe struct member offsets.
-
-
Constructor Details
-
OVRLayerCylinder
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 Details
-
sizeof
public int sizeof()Description copied from class:Struct
Returnssizeof(struct)
.- Specified by:
sizeof
in classStruct<OVRLayerCylinder>
-
Header
Header.Type
must beLayerType_Cylinder
-
ColorTexture
public long ColorTexture()contains a single image, never with any stereo view -
Viewport
specifies the ColorTexture sub-rect UV coordinates -
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 byRecenterTrackingOrigin
unless theLayerFlag_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 to2*Pi
exclusive 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
Copies the specifiedOVRLayerHeader
to theHeader()
field. -
Header
-
ColorTexture
Sets the specified value to theColorTexture()
field. -
Viewport
Copies the specifiedOVRRecti
to theViewport()
field. -
Viewport
Passes theViewport()
field to the specifiedConsumer
. -
CylinderPoseCenter
Copies the specifiedOVRPosef
to theCylinderPoseCenter()
field. -
CylinderPoseCenter
Passes theCylinderPoseCenter()
field to the specifiedConsumer
. -
CylinderRadius
Sets the specified value to theCylinderRadius()
field. -
CylinderAngle
Sets the specified value to theCylinderAngle()
field. -
CylinderAspectRatio
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
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
Returns a newOVRLayerCylinder
instance allocated withmemAlloc
. The instance must be explicitly freed. -
calloc
Returns a newOVRLayerCylinder
instance allocated withmemCalloc
. The instance must be explicitly freed. -
create
Returns a newOVRLayerCylinder
instance allocated withBufferUtils
. -
create
Returns a newOVRLayerCylinder
instance for the specified memory address. -
createSafe
-
malloc
Returns a newOVRLayerCylinder.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
Returns a newOVRLayerCylinder.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
Returns a newOVRLayerCylinder.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
Create aOVRLayerCylinder.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
-
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)
instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)
instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)
instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)
instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)
instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)
instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)
instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)
instead. -
malloc
Returns a newOVRLayerCylinder
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
calloc
Returns a newOVRLayerCylinder
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
malloc
Returns a newOVRLayerCylinder.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
capacity
- the buffer capacitystack
- the stack from which to allocate
-
calloc
Returns a newOVRLayerCylinder.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacitystack
- the stack from which to allocate
-
nHeader
Unsafe version ofHeader()
. -
nColorTexture
public static long nColorTexture(long struct) Unsafe version ofColorTexture()
. -
nViewport
Unsafe version ofViewport()
. -
nCylinderPoseCenter
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
Unsafe version ofHeader
. -
nColorTexture
public static void nColorTexture(long struct, long value) Unsafe version ofColorTexture
. -
nViewport
Unsafe version ofViewport
. -
nCylinderPoseCenter
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
-