Package org.lwjgl.openxr
Class XrVector2f
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.openxr.XrVector2f
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class XrVector2f extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceTwo-dimensional vector.Description
If used to represent physical distances (rather than e.g. normalized direction) and not otherwise specified, values must be in meters.
See Also
XrActionStateVector2f,XrCompositionLayerEquirectKHR,XrHandTrackingMeshFB,XrPosef,XrQuaternionf,XrVector3f,XrVector4f,XrVisibilityMaskKHR,SetInputDeviceStateVector2fEXTLayout
struct XrVector2f { floatx(); floaty(); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXrVector2f.BufferAn array ofXrVector2fstructs.
-
Constructor Summary
Constructors Constructor Description XrVector2f(java.nio.ByteBuffer container)Creates aXrVector2finstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static XrVector2fcalloc()Returns a newXrVector2finstance allocated withmemCalloc.static XrVector2f.Buffercalloc(int capacity)Returns a newXrVector2f.Bufferinstance allocated withmemCalloc.static XrVector2f.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newXrVector2f.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static XrVector2fcalloc(org.lwjgl.system.MemoryStack stack)Returns a newXrVector2finstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static XrVector2fcreate()Returns a newXrVector2finstance allocated withBufferUtils.static XrVector2f.Buffercreate(int capacity)Returns a newXrVector2f.Bufferinstance allocated withBufferUtils.static XrVector2fcreate(long address)Returns a newXrVector2finstance for the specified memory address.static XrVector2f.Buffercreate(long address, int capacity)Create aXrVector2f.Bufferinstance at the specified memory.static XrVector2fcreateSafe(long address)static XrVector2f.BuffercreateSafe(long address, int capacity)static XrVector2fmalloc()Returns a newXrVector2finstance allocated withmemAlloc.static XrVector2f.Buffermalloc(int capacity)Returns a newXrVector2f.Bufferinstance allocated withmemAlloc.static XrVector2f.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newXrVector2f.Bufferinstance allocated on the specifiedMemoryStack.static XrVector2fmalloc(org.lwjgl.system.MemoryStack stack)Returns a newXrVector2finstance allocated on the specifiedMemoryStack.static floatnx(long struct)Unsafe version ofx().static voidnx(long struct, float value)Unsafe version ofx.static floatny(long struct)Unsafe version ofy().static voidny(long struct, float value)Unsafe version ofy.XrVector2fset(float x, float y)Initializes this struct with the specified values.XrVector2fset(XrVector2f src)Copies the specified struct data to this struct.intsizeof()floatx()the x coordinate of the vector.XrVector2fx(float value)Sets the specified value to thex()field.floaty()the y coordinate of the vector.XrVector2fy(float value)Sets the specified value to they()field.
-
-
-
Constructor Detail
-
XrVector2f
public XrVector2f(java.nio.ByteBuffer container)
Creates aXrVector2finstance 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
-
x
public float x()
the x coordinate of the vector.
-
y
public float y()
the y coordinate of the vector.
-
x
public XrVector2f x(float value)
Sets the specified value to thex()field.
-
y
public XrVector2f y(float value)
Sets the specified value to they()field.
-
set
public XrVector2f set(float x, float y)
Initializes this struct with the specified values.
-
set
public XrVector2f set(XrVector2f src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static XrVector2f malloc()
Returns a newXrVector2finstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static XrVector2f calloc()
Returns a newXrVector2finstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static XrVector2f create()
Returns a newXrVector2finstance allocated withBufferUtils.
-
create
public static XrVector2f create(long address)
Returns a newXrVector2finstance for the specified memory address.
-
createSafe
@Nullable public static XrVector2f createSafe(long address)
-
malloc
public static XrVector2f.Buffer malloc(int capacity)
Returns a newXrVector2f.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static XrVector2f.Buffer calloc(int capacity)
Returns a newXrVector2f.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static XrVector2f.Buffer create(int capacity)
Returns a newXrVector2f.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static XrVector2f.Buffer create(long address, int capacity)
Create aXrVector2f.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static XrVector2f.Buffer createSafe(long address, int capacity)
-
malloc
public static XrVector2f malloc(org.lwjgl.system.MemoryStack stack)
Returns a newXrVector2finstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static XrVector2f calloc(org.lwjgl.system.MemoryStack stack)
Returns a newXrVector2finstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static XrVector2f.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newXrVector2f.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static XrVector2f.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newXrVector2f.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nx
public static float nx(long struct)
Unsafe version ofx().
-
ny
public static float ny(long struct)
Unsafe version ofy().
-
nx
public static void nx(long struct, float value)Unsafe version ofx.
-
ny
public static void ny(long struct, float value)Unsafe version ofy.
-
-