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();
}-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.lwjgl.system.Struct
org.lwjgl.system.Struct.StructValidationNested classes/interfaces inherited from interface org.lwjgl.system.Pointer
org.lwjgl.system.Pointer.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe struct alignment in bytes.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct size in bytes.static final intThe struct member offsets.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionOVRLayerCylinder(ByteBuffer container) Creates aOVRLayerCylinderinstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 OVRLayerCylinderDeprecated.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.longcontains a single image, never with any stereo viewColorTexture(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 @Nullable OVRLayerCylindercreateSafe(long address) static @Nullable OVRLayerCylinder.BuffercreateSafe(long address, int capacity) floatangle in radians.CylinderAngle(float value) Sets the specified value to theCylinderAngle()field.floatcustom 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 specifiedOVRPosefto theCylinderPoseCenter()field.floatradius of the cylinder in metersCylinderRadius(float value) Sets the specified value to theCylinderRadius()field.Header()Header.Typemust beLayerType_CylinderHeader(Consumer<OVRLayerHeader> consumer) Header(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 OVRLayerCylinderDeprecated.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 voidUnsafe 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.intsizeof()static voidvalidate(long struct) Validates pointer members that should not beNULL.Viewport()specifies the ColorTexture sub-rect UV coordinatesPasses theViewport()field to the specifiedConsumer.Copies the specifiedOVRRectito theViewport()field.Methods inherited from class org.lwjgl.system.Struct
clear, free, isNull, validate, validateMethods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toStringMethods 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 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 Details
-
sizeof
public int sizeof()- Specified by:
sizeofin classorg.lwjgl.system.Struct<OVRLayerCylinder>
-
Header
Header.Typemust 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 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
Copies the specifiedOVRLayerHeaderto theHeader()field. -
Header
-
ColorTexture
Sets the specified value to theColorTexture()field. -
Viewport
Copies the specifiedOVRRectito theViewport()field. -
Viewport
Passes theViewport()field to the specifiedConsumer. -
CylinderPoseCenter
Copies the specifiedOVRPosefto 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 newOVRLayerCylinderinstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newOVRLayerCylinderinstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newOVRLayerCylinderinstance allocated withBufferUtils. -
create
Returns a newOVRLayerCylinderinstance for the specified memory address. -
createSafe
-
malloc
Returns a newOVRLayerCylinder.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newOVRLayerCylinder.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newOVRLayerCylinder.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aOVRLayerCylinder.Bufferinstance 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 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
Returns a newOVRLayerCylinderinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newOVRLayerCylinderinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
Returns a newOVRLayerCylinder.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
Returns a newOVRLayerCylinder.Bufferinstance allocated on the specifiedMemoryStackand 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
-