Package org.lwjgl.openvr
Class TrackedDevicePose
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.openvr.TrackedDevicePose
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class TrackedDevicePose extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Describes a single pose for a tracked object.Member documentation
vVelocity
– velocity in tracker space in m/svAngularVelocity
– angular velocity in radians/seTrackingResult
– one of:bDeviceIsConnected
– This indicates that there is a device connected for this spot in the pose array. It could go from true to false if the user unplugs the device.
Layout
struct TrackedDevicePose_t {
HmdMatrix34_t
mDeviceToAbsoluteTracking;HmdVector3_t
vVelocity;HmdVector3_t
vAngularVelocity; ETrackingResult eTrackingResult; bool bPoseIsValid; bool bDeviceIsConnected; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TrackedDevicePose.Buffer
An array ofTrackedDevicePose
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
BDEVICEISCONNECTED
BPOSEISVALID
ETRACKINGRESULT
MDEVICETOABSOLUTETRACKINGThe struct member offsets.static int
SIZEOF
The struct size in bytes.static int
VANGULARVELOCITY
VVELOCITYThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description TrackedDevicePose(java.nio.ByteBuffer container)
Creates aTrackedDevicePose
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
bDeviceIsConnected()
Returns the value of thebDeviceIsConnected
field.TrackedDevicePose
bDeviceIsConnected(boolean value)
Sets the specified value to thebDeviceIsConnected
field.boolean
bPoseIsValid()
Returns the value of thebPoseIsValid
field.TrackedDevicePose
bPoseIsValid(boolean value)
Sets the specified value to thebPoseIsValid
field.static TrackedDevicePose
calloc()
Returns a newTrackedDevicePose
instance allocated withmemCalloc
.static TrackedDevicePose.Buffer
calloc(int capacity)
Returns a newTrackedDevicePose.Buffer
instance allocated withmemCalloc
.static TrackedDevicePose
callocStack()
Returns a newTrackedDevicePose
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static TrackedDevicePose.Buffer
callocStack(int capacity)
Returns a newTrackedDevicePose.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static TrackedDevicePose.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newTrackedDevicePose.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static TrackedDevicePose
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newTrackedDevicePose
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static TrackedDevicePose
create()
Returns a newTrackedDevicePose
instance allocated withBufferUtils
.static TrackedDevicePose.Buffer
create(int capacity)
Returns a newTrackedDevicePose.Buffer
instance allocated withBufferUtils
.static TrackedDevicePose
create(long address)
Returns a newTrackedDevicePose
instance for the specified memory address.static TrackedDevicePose.Buffer
create(long address, int capacity)
Create aTrackedDevicePose.Buffer
instance at the specified memory.static TrackedDevicePose
createSafe(long address)
static TrackedDevicePose.Buffer
createSafe(long address, int capacity)
int
eTrackingResult()
Returns the value of theeTrackingResult
field.TrackedDevicePose
eTrackingResult(int value)
Sets the specified value to theeTrackingResult
field.static TrackedDevicePose
malloc()
Returns a newTrackedDevicePose
instance allocated withmemAlloc
.static TrackedDevicePose.Buffer
malloc(int capacity)
Returns a newTrackedDevicePose.Buffer
instance allocated withmemAlloc
.static TrackedDevicePose
mallocStack()
Returns a newTrackedDevicePose
instance allocated on the thread-localMemoryStack
.static TrackedDevicePose.Buffer
mallocStack(int capacity)
Returns a newTrackedDevicePose.Buffer
instance allocated on the thread-localMemoryStack
.static TrackedDevicePose.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newTrackedDevicePose.Buffer
instance allocated on the specifiedMemoryStack
.static TrackedDevicePose
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newTrackedDevicePose
instance allocated on the specifiedMemoryStack
.HmdMatrix34
mDeviceToAbsoluteTracking()
Returns aHmdMatrix34
view of themDeviceToAbsoluteTracking
field.TrackedDevicePose
mDeviceToAbsoluteTracking(java.util.function.Consumer<HmdMatrix34> consumer)
Passes themDeviceToAbsoluteTracking
field to the specifiedConsumer
.TrackedDevicePose
mDeviceToAbsoluteTracking(HmdMatrix34 value)
Copies the specifiedHmdMatrix34
to themDeviceToAbsoluteTracking
field.static boolean
nbDeviceIsConnected(long struct)
Unsafe version ofbDeviceIsConnected()
.static void
nbDeviceIsConnected(long struct, boolean value)
Unsafe version ofbDeviceIsConnected
.static boolean
nbPoseIsValid(long struct)
Unsafe version ofbPoseIsValid()
.static void
nbPoseIsValid(long struct, boolean value)
Unsafe version ofbPoseIsValid
.static int
neTrackingResult(long struct)
Unsafe version ofeTrackingResult()
.static void
neTrackingResult(long struct, int value)
Unsafe version ofeTrackingResult
.static HmdMatrix34
nmDeviceToAbsoluteTracking(long struct)
Unsafe version ofmDeviceToAbsoluteTracking()
.static void
nmDeviceToAbsoluteTracking(long struct, HmdMatrix34 value)
Unsafe version ofmDeviceToAbsoluteTracking
.static HmdVector3
nvAngularVelocity(long struct)
Unsafe version ofvAngularVelocity()
.static void
nvAngularVelocity(long struct, HmdVector3 value)
Unsafe version ofvAngularVelocity
.static HmdVector3
nvVelocity(long struct)
Unsafe version ofvVelocity()
.static void
nvVelocity(long struct, HmdVector3 value)
Unsafe version ofvVelocity
.TrackedDevicePose
set(HmdMatrix34 mDeviceToAbsoluteTracking, HmdVector3 vVelocity, HmdVector3 vAngularVelocity, int eTrackingResult, boolean bPoseIsValid, boolean bDeviceIsConnected)
Initializes this struct with the specified values.TrackedDevicePose
set(TrackedDevicePose src)
Copies the specified struct data to this struct.int
sizeof()
HmdVector3
vAngularVelocity()
Returns aHmdVector3
view of thevAngularVelocity
field.TrackedDevicePose
vAngularVelocity(java.util.function.Consumer<HmdVector3> consumer)
Passes thevAngularVelocity
field to the specifiedConsumer
.TrackedDevicePose
vAngularVelocity(HmdVector3 value)
Copies the specifiedHmdVector3
to thevAngularVelocity
field.HmdVector3
vVelocity()
Returns aHmdVector3
view of thevVelocity
field.TrackedDevicePose
vVelocity(java.util.function.Consumer<HmdVector3> consumer)
Passes thevVelocity
field to the specifiedConsumer
.TrackedDevicePose
vVelocity(HmdVector3 value)
Copies the specifiedHmdVector3
to thevVelocity
field.
-
-
-
Constructor Detail
-
TrackedDevicePose
public TrackedDevicePose(java.nio.ByteBuffer container)
Creates aTrackedDevicePose
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
-
mDeviceToAbsoluteTracking
public HmdMatrix34 mDeviceToAbsoluteTracking()
Returns aHmdMatrix34
view of themDeviceToAbsoluteTracking
field.
-
vVelocity
public HmdVector3 vVelocity()
Returns aHmdVector3
view of thevVelocity
field.
-
vAngularVelocity
public HmdVector3 vAngularVelocity()
Returns aHmdVector3
view of thevAngularVelocity
field.
-
eTrackingResult
public int eTrackingResult()
Returns the value of theeTrackingResult
field.
-
bPoseIsValid
public boolean bPoseIsValid()
Returns the value of thebPoseIsValid
field.
-
bDeviceIsConnected
public boolean bDeviceIsConnected()
Returns the value of thebDeviceIsConnected
field.
-
mDeviceToAbsoluteTracking
public TrackedDevicePose mDeviceToAbsoluteTracking(HmdMatrix34 value)
Copies the specifiedHmdMatrix34
to themDeviceToAbsoluteTracking
field.
-
mDeviceToAbsoluteTracking
public TrackedDevicePose mDeviceToAbsoluteTracking(java.util.function.Consumer<HmdMatrix34> consumer)
Passes themDeviceToAbsoluteTracking
field to the specifiedConsumer
.
-
vVelocity
public TrackedDevicePose vVelocity(HmdVector3 value)
Copies the specifiedHmdVector3
to thevVelocity
field.
-
vVelocity
public TrackedDevicePose vVelocity(java.util.function.Consumer<HmdVector3> consumer)
Passes thevVelocity
field to the specifiedConsumer
.
-
vAngularVelocity
public TrackedDevicePose vAngularVelocity(HmdVector3 value)
Copies the specifiedHmdVector3
to thevAngularVelocity
field.
-
vAngularVelocity
public TrackedDevicePose vAngularVelocity(java.util.function.Consumer<HmdVector3> consumer)
Passes thevAngularVelocity
field to the specifiedConsumer
.
-
eTrackingResult
public TrackedDevicePose eTrackingResult(int value)
Sets the specified value to theeTrackingResult
field.
-
bPoseIsValid
public TrackedDevicePose bPoseIsValid(boolean value)
Sets the specified value to thebPoseIsValid
field.
-
bDeviceIsConnected
public TrackedDevicePose bDeviceIsConnected(boolean value)
Sets the specified value to thebDeviceIsConnected
field.
-
set
public TrackedDevicePose set(HmdMatrix34 mDeviceToAbsoluteTracking, HmdVector3 vVelocity, HmdVector3 vAngularVelocity, int eTrackingResult, boolean bPoseIsValid, boolean bDeviceIsConnected)
Initializes this struct with the specified values.
-
set
public TrackedDevicePose set(TrackedDevicePose src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static TrackedDevicePose malloc()
Returns a newTrackedDevicePose
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static TrackedDevicePose calloc()
Returns a newTrackedDevicePose
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static TrackedDevicePose create()
Returns a newTrackedDevicePose
instance allocated withBufferUtils
.
-
create
public static TrackedDevicePose create(long address)
Returns a newTrackedDevicePose
instance for the specified memory address.
-
createSafe
@Nullable public static TrackedDevicePose createSafe(long address)
-
malloc
public static TrackedDevicePose.Buffer malloc(int capacity)
Returns a newTrackedDevicePose.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static TrackedDevicePose.Buffer calloc(int capacity)
Returns a newTrackedDevicePose.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static TrackedDevicePose.Buffer create(int capacity)
Returns a newTrackedDevicePose.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static TrackedDevicePose.Buffer create(long address, int capacity)
Create aTrackedDevicePose.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static TrackedDevicePose.Buffer createSafe(long address, int capacity)
-
mallocStack
public static TrackedDevicePose mallocStack()
Returns a newTrackedDevicePose
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static TrackedDevicePose callocStack()
Returns a newTrackedDevicePose
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static TrackedDevicePose mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newTrackedDevicePose
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static TrackedDevicePose callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newTrackedDevicePose
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static TrackedDevicePose.Buffer mallocStack(int capacity)
Returns a newTrackedDevicePose.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static TrackedDevicePose.Buffer callocStack(int capacity)
Returns a newTrackedDevicePose.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static TrackedDevicePose.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newTrackedDevicePose.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static TrackedDevicePose.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newTrackedDevicePose.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
nmDeviceToAbsoluteTracking
public static HmdMatrix34 nmDeviceToAbsoluteTracking(long struct)
Unsafe version ofmDeviceToAbsoluteTracking()
.
-
nvVelocity
public static HmdVector3 nvVelocity(long struct)
Unsafe version ofvVelocity()
.
-
nvAngularVelocity
public static HmdVector3 nvAngularVelocity(long struct)
Unsafe version ofvAngularVelocity()
.
-
neTrackingResult
public static int neTrackingResult(long struct)
Unsafe version ofeTrackingResult()
.
-
nbPoseIsValid
public static boolean nbPoseIsValid(long struct)
Unsafe version ofbPoseIsValid()
.
-
nbDeviceIsConnected
public static boolean nbDeviceIsConnected(long struct)
Unsafe version ofbDeviceIsConnected()
.
-
nmDeviceToAbsoluteTracking
public static void nmDeviceToAbsoluteTracking(long struct, HmdMatrix34 value)
Unsafe version ofmDeviceToAbsoluteTracking
.
-
nvVelocity
public static void nvVelocity(long struct, HmdVector3 value)
Unsafe version ofvVelocity
.
-
nvAngularVelocity
public static void nvAngularVelocity(long struct, HmdVector3 value)
Unsafe version ofvAngularVelocity
.
-
neTrackingResult
public static void neTrackingResult(long struct, int value)
Unsafe version ofeTrackingResult
.
-
nbPoseIsValid
public static void nbPoseIsValid(long struct, boolean value)
Unsafe version ofbPoseIsValid
.
-
nbDeviceIsConnected
public static void nbDeviceIsConnected(long struct, boolean value)
Unsafe version ofbDeviceIsConnected
.
-
-