Class XrScenePlaneMSFT
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.openxr.XrScenePlaneMSFT
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class XrScenePlaneMSFT extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceScene plane.Description
The
sizeof a plane refers to the plane’s size in thex-yplane of the plane’s coordinate system. A plane with a position of {0,0,0}, rotation of {0,0,0,1} (no rotation), and an extent of {1,1} refers to a 1 meter x 1 meter plane centered at {0,0,0} with its front face normal vector pointing towards the +Z direction in the plane component’s space. For planes with an alignment ofSCENE_PLANE_ALIGNMENT_TYPE_VERTICAL_MSFT, the +Y direction must point up away from the direction of gravity.Note
OpenXR uses an X-Y plane with +Z as the plane normal but other APIs may use an X-Z plane with +Y as the plane normal. The X-Y plane can be converted to an X-Z plane by rotating
-π/2radians around the +X axis.Valid Usage (Implicit)
- The
XR_MSFT_scene_understandingextension must be enabled prior to usingXrScenePlaneMSFT alignmentmust be a validXrScenePlaneAlignmentTypeMSFTvalue
See Also
XrExtent2Df,XrScenePlanesMSFTLayout
struct XrScenePlaneMSFT { XrScenePlaneAlignmentTypeMSFTalignment();XrExtent2Dfsize(); uint64_tmeshBufferId(); XrBool32supportsIndicesUint16(); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXrScenePlaneMSFT.BufferAn array ofXrScenePlaneMSFTstructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNMENTThe struct member offsets.static intALIGNOFThe struct alignment in bytes.static intMESHBUFFERID
SIZEThe struct member offsets.static intSIZEOFThe struct size in bytes.static intSUPPORTSINDICESUINT16The struct member offsets.
-
Constructor Summary
Constructors Constructor Description XrScenePlaneMSFT(java.nio.ByteBuffer container)Creates aXrScenePlaneMSFTinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intalignment()the alignment type of the plane specified byXrScenePlaneAlignmentTypeMSFT.XrScenePlaneMSFTalignment(int value)Sets the specified value to thealignment()field.static XrScenePlaneMSFTcalloc()Returns a newXrScenePlaneMSFTinstance allocated withmemCalloc.static XrScenePlaneMSFT.Buffercalloc(int capacity)Returns a newXrScenePlaneMSFT.Bufferinstance allocated withmemCalloc.static XrScenePlaneMSFT.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newXrScenePlaneMSFT.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static XrScenePlaneMSFTcalloc(org.lwjgl.system.MemoryStack stack)Returns a newXrScenePlaneMSFTinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static XrScenePlaneMSFTcreate()Returns a newXrScenePlaneMSFTinstance allocated withBufferUtils.static XrScenePlaneMSFT.Buffercreate(int capacity)Returns a newXrScenePlaneMSFT.Bufferinstance allocated withBufferUtils.static XrScenePlaneMSFTcreate(long address)Returns a newXrScenePlaneMSFTinstance for the specified memory address.static XrScenePlaneMSFT.Buffercreate(long address, int capacity)Create aXrScenePlaneMSFT.Bufferinstance at the specified memory.static XrScenePlaneMSFTcreateSafe(long address)static XrScenePlaneMSFT.BuffercreateSafe(long address, int capacity)static XrScenePlaneMSFTmalloc()Returns a newXrScenePlaneMSFTinstance allocated withmemAlloc.static XrScenePlaneMSFT.Buffermalloc(int capacity)Returns a newXrScenePlaneMSFT.Bufferinstance allocated withmemAlloc.static XrScenePlaneMSFT.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newXrScenePlaneMSFT.Bufferinstance allocated on the specifiedMemoryStack.static XrScenePlaneMSFTmalloc(org.lwjgl.system.MemoryStack stack)Returns a newXrScenePlaneMSFTinstance allocated on the specifiedMemoryStack.longmeshBufferId()theuint64_tidentifier that specifies the scene mesh buffer of this plane’s triangle mesh.XrScenePlaneMSFTmeshBufferId(long value)Sets the specified value to themeshBufferId()field.static intnalignment(long struct)Unsafe version ofalignment().static voidnalignment(long struct, int value)Unsafe version ofalignment.static longnmeshBufferId(long struct)Unsafe version ofmeshBufferId().static voidnmeshBufferId(long struct, long value)Unsafe version ofmeshBufferId.static XrExtent2Dfnsize(long struct)Unsafe version ofsize().static voidnsize(long struct, XrExtent2Df value)Unsafe version ofsize.static intnsupportsIndicesUint16(long struct)Unsafe version ofsupportsIndicesUint16().static voidnsupportsIndicesUint16(long struct, int value)Unsafe version ofsupportsIndicesUint16.XrScenePlaneMSFTset(int alignment, XrExtent2Df size, long meshBufferId, boolean supportsIndicesUint16)Initializes this struct with the specified values.XrScenePlaneMSFTset(XrScenePlaneMSFT src)Copies the specified struct data to this struct.XrExtent2Dfsize()the 2D size of the plane’s extent, wheresize::widthis the width of the plane along the X axis, andsize::heightis the height of the plane along the Y axis.XrScenePlaneMSFTsize(java.util.function.Consumer<XrExtent2Df> consumer)Passes thesize()field to the specifiedConsumer.XrScenePlaneMSFTsize(XrExtent2Df value)Copies the specifiedXrExtent2Dfto thesize()field.intsizeof()booleansupportsIndicesUint16()TRUEif the mesh supports reading 16-bit unsigned indices.XrScenePlaneMSFTsupportsIndicesUint16(boolean value)Sets the specified value to thesupportsIndicesUint16()field.
-
-
-
Constructor Detail
-
XrScenePlaneMSFT
public XrScenePlaneMSFT(java.nio.ByteBuffer container)
Creates aXrScenePlaneMSFTinstance 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
-
alignment
public int alignment()
the alignment type of the plane specified byXrScenePlaneAlignmentTypeMSFT.
-
size
public XrExtent2Df size()
the 2D size of the plane’s extent, wheresize::widthis the width of the plane along the X axis, andsize::heightis the height of the plane along the Y axis.
-
meshBufferId
public long meshBufferId()
theuint64_tidentifier that specifies the scene mesh buffer of this plane’s triangle mesh. IfmeshBufferIdis zero then this plane does not have a mesh. The triangles in a planar mesh are coplanar.
-
supportsIndicesUint16
public boolean supportsIndicesUint16()
TRUEif the mesh supports reading 16-bit unsigned indices.
-
alignment
public XrScenePlaneMSFT alignment(int value)
Sets the specified value to thealignment()field.
-
size
public XrScenePlaneMSFT size(XrExtent2Df value)
Copies the specifiedXrExtent2Dfto thesize()field.
-
size
public XrScenePlaneMSFT size(java.util.function.Consumer<XrExtent2Df> consumer)
Passes thesize()field to the specifiedConsumer.
-
meshBufferId
public XrScenePlaneMSFT meshBufferId(long value)
Sets the specified value to themeshBufferId()field.
-
supportsIndicesUint16
public XrScenePlaneMSFT supportsIndicesUint16(boolean value)
Sets the specified value to thesupportsIndicesUint16()field.
-
set
public XrScenePlaneMSFT set(int alignment, XrExtent2Df size, long meshBufferId, boolean supportsIndicesUint16)
Initializes this struct with the specified values.
-
set
public XrScenePlaneMSFT set(XrScenePlaneMSFT src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static XrScenePlaneMSFT malloc()
Returns a newXrScenePlaneMSFTinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static XrScenePlaneMSFT calloc()
Returns a newXrScenePlaneMSFTinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static XrScenePlaneMSFT create()
Returns a newXrScenePlaneMSFTinstance allocated withBufferUtils.
-
create
public static XrScenePlaneMSFT create(long address)
Returns a newXrScenePlaneMSFTinstance for the specified memory address.
-
createSafe
@Nullable public static XrScenePlaneMSFT createSafe(long address)
-
malloc
public static XrScenePlaneMSFT.Buffer malloc(int capacity)
Returns a newXrScenePlaneMSFT.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static XrScenePlaneMSFT.Buffer calloc(int capacity)
Returns a newXrScenePlaneMSFT.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static XrScenePlaneMSFT.Buffer create(int capacity)
Returns a newXrScenePlaneMSFT.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static XrScenePlaneMSFT.Buffer create(long address, int capacity)
Create aXrScenePlaneMSFT.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static XrScenePlaneMSFT.Buffer createSafe(long address, int capacity)
-
malloc
public static XrScenePlaneMSFT malloc(org.lwjgl.system.MemoryStack stack)
Returns a newXrScenePlaneMSFTinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static XrScenePlaneMSFT calloc(org.lwjgl.system.MemoryStack stack)
Returns a newXrScenePlaneMSFTinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static XrScenePlaneMSFT.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newXrScenePlaneMSFT.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static XrScenePlaneMSFT.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newXrScenePlaneMSFT.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nalignment
public static int nalignment(long struct)
Unsafe version ofalignment().
-
nsize
public static XrExtent2Df nsize(long struct)
Unsafe version ofsize().
-
nmeshBufferId
public static long nmeshBufferId(long struct)
Unsafe version ofmeshBufferId().
-
nsupportsIndicesUint16
public static int nsupportsIndicesUint16(long struct)
Unsafe version ofsupportsIndicesUint16().
-
nalignment
public static void nalignment(long struct, int value)Unsafe version ofalignment.
-
nsize
public static void nsize(long struct, XrExtent2Df value)Unsafe version ofsize.
-
nmeshBufferId
public static void nmeshBufferId(long struct, long value)Unsafe version ofmeshBufferId.
-
nsupportsIndicesUint16
public static void nsupportsIndicesUint16(long struct, int value)Unsafe version ofsupportsIndicesUint16.
-
-