Top Description Fields Constructors Methods
org.lwjgl.openxr

public Class MSFTControllerModel

extends Object
Class Inheritance
Imports
javax.annotation.*, java.nio.*, org.lwjgl.system.*

The XR_MSFT_controller_model extension.

This extension provides a mechanism to load a GLTF model for controllers. An application can render the controller model using the real time pose input from controller’s grip action pose and animate controller parts representing the user’s interactions, such as pressing a button, or pulling a trigger.

This extension supports any controller interaction profile that supports subpathname:/grip/pose. The returned controller model represents the physical controller held in the user’s hands, and it may be different from the current interaction profile.

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
XR_MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT

XR_MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT

public static final String
public static final int
XR_MSFT_controller_model_SPEC_VERSION

The extension specification version.

public static final long
public static final int
public static final int
public static final int
public static final int
public static final int
XR_TYPE_CONTROLLER_MODEL_STATE_MSFT

Extends XrStructureType.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static int
nxrGetControllerModelKeyMSFT(XrSession session, long topLevelUserPath, long controllerModelKeyState)

Unsafe version of: GetControllerModelKeyMSFT

public static int
nxrGetControllerModelPropertiesMSFT(XrSession session, long modelKey, long properties)

Unsafe version of: GetControllerModelPropertiesMSFT

public static int
nxrGetControllerModelStateMSFT(XrSession session, long modelKey, long state)

Unsafe version of: GetControllerModelStateMSFT

public static int
nxrLoadControllerModelMSFT(XrSession session, long modelKey, int
the capacity of the buffer array, or 0 to indicate a request to retrieve the required capacity.
bufferCapacityInput
,
long bufferCountOutput, long buffer)

Unsafe version of: LoadControllerModelMSFT

public static int
xrGetControllerModelKeyMSFT(XrSession
the specified XrSession.
session
,
long
the top level user path corresponding to the controller render model being queried (e.g. pathname:/user/hand/left or pathname:/user/hand/right).
topLevelUserPath
,
XrControllerModelKeyStateMSFT
a pointer to the XrControllerModelKeyStateMSFT to write the model key state to.
controllerModelKeyState
)

Retrieve the model key for the controller.

public static int
xrGetControllerModelPropertiesMSFT(XrSession
the specified XrSession.
session
,
long
a valid model key obtained from XrControllerModelKeyStateMSFT
modelKey
,
XrControllerModelPropertiesMSFT
an XrControllerModelPropertiesMSFT returning the properties of the controller model
properties
)

Get controller model properties.

public static int
xrGetControllerModelStateMSFT(XrSession
the specified XrSession.
session
,
long
the model key corresponding to the controller model being queried.
modelKey
,
XrControllerModelStateMSFT
a pointer to XrControllerModelNodeStateMSFT returns the current controller model state.
state
)

Get controller model state.

public static int
xrLoadControllerModelMSFT(XrSession
the specified XrSession.
session
,
long
the model key corresponding to the controller render model being queried.
modelKey
,
IntBuffer
filled in by the runtime with the count of elements in buffer array, or returns the required capacity in the case that bufferCapacityInput is insufficient.
bufferCountOutput
,
ByteBuffer
a pointer to an application-allocated array of the model for the device that will be filled with the uint8_t values by the runtime. It can be NULL if bufferCapacityInput is 0.
buffer
)

Load controller render model.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

XR_ERROR_CONTROLLER_MODEL_KEY_INVALID_MSFTback to summary
public static final int XR_ERROR_CONTROLLER_MODEL_KEY_INVALID_MSFT

Extends XrResult.

XR_MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFTback to summary
public static final int XR_MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT

XR_MAX_CONTROLLER_MODEL_NODE_NAME_SIZE_MSFT

XR_MSFT_CONTROLLER_MODEL_EXTENSION_NAMEback to summary
public static final String XR_MSFT_CONTROLLER_MODEL_EXTENSION_NAME

The extension name.

XR_MSFT_controller_model_SPEC_VERSIONback to summary
public static final int XR_MSFT_controller_model_SPEC_VERSION

The extension specification version.

XR_NULL_CONTROLLER_MODEL_KEY_MSFTback to summary
public static final long XR_NULL_CONTROLLER_MODEL_KEY_MSFT

API Constants

XR_TYPE_CONTROLLER_MODEL_KEY_STATE_MSFTback to summary
public static final int XR_TYPE_CONTROLLER_MODEL_KEY_STATE_MSFT

Extends XrStructureType.

Enum values:
XR_TYPE_CONTROLLER_MODEL_NODE_PROPERTIES_MSFTback to summary
public static final int XR_TYPE_CONTROLLER_MODEL_NODE_PROPERTIES_MSFT

Extends XrStructureType.

Enum values:
XR_TYPE_CONTROLLER_MODEL_NODE_STATE_MSFTback to summary
public static final int XR_TYPE_CONTROLLER_MODEL_NODE_STATE_MSFT

Extends XrStructureType.

Enum values:
XR_TYPE_CONTROLLER_MODEL_PROPERTIES_MSFTback to summary
public static final int XR_TYPE_CONTROLLER_MODEL_PROPERTIES_MSFT

Extends XrStructureType.

Enum values:
XR_TYPE_CONTROLLER_MODEL_STATE_MSFTback to summary
public static final int XR_TYPE_CONTROLLER_MODEL_STATE_MSFT

Extends XrStructureType.

Enum values:

Constructor Detail

MSFTControllerModelback to summary
protected MSFTControllerModel()

Method Detail

nxrGetControllerModelKeyMSFTback to summary
public static int nxrGetControllerModelKeyMSFT(XrSession session, long topLevelUserPath, long controllerModelKeyState)

Unsafe version of: GetControllerModelKeyMSFT

nxrGetControllerModelPropertiesMSFTback to summary
public static int nxrGetControllerModelPropertiesMSFT(XrSession session, long modelKey, long properties)

Unsafe version of: GetControllerModelPropertiesMSFT

nxrGetControllerModelStateMSFTback to summary
public static int nxrGetControllerModelStateMSFT(XrSession session, long modelKey, long state)

Unsafe version of: GetControllerModelStateMSFT

nxrLoadControllerModelMSFTback to summary
public static int nxrLoadControllerModelMSFT(XrSession session, long modelKey, int bufferCapacityInput, long bufferCountOutput, long buffer)

Unsafe version of: LoadControllerModelMSFT

Parameters
bufferCapacityInput:int

the capacity of the buffer array, or 0 to indicate a request to retrieve the required capacity.

xrGetControllerModelKeyMSFTback to summary
public static int xrGetControllerModelKeyMSFT(XrSession session, long topLevelUserPath, XrControllerModelKeyStateMSFT controllerModelKeyState)

Retrieve the model key for the controller.

C Specification

GetControllerModelKeyMSFT retrieves the XrControllerModelKeyMSFT for a controller. This model key may later be used to retrieve the model data.

The GetControllerModelKeyMSFT function is defined as:


XrResult xrGetControllerModelKeyMSFT(
    XrSession                                   session,
    XrPath                                      topLevelUserPath,
    XrControllerModelKeyStateMSFT*              controllerModelKeyState);
Valid Usage (Implicit)
Return Codes
On success, this command returns
On failure, this command returns
See Also

XrControllerModelKeyStateMSFT

Parameters
session:XrSession

the specified XrSession.

topLevelUserPath:long

the top level user path corresponding to the controller render model being queried (e.g. pathname:/user/hand/left or pathname:/user/hand/right).

controllerModelKeyState:XrControllerModelKeyStateMSFT

a pointer to the XrControllerModelKeyStateMSFT to write the model key state to.

Annotations
@NativeType:XrResult
xrGetControllerModelPropertiesMSFTback to summary
public static int xrGetControllerModelPropertiesMSFT(XrSession session, long modelKey, XrControllerModelPropertiesMSFT properties)

Get controller model properties.

C Specification

The GetControllerModelPropertiesMSFT function returns the controller model properties for a given modelKey.


XrResult xrGetControllerModelPropertiesMSFT(
    XrSession                                   session,
    XrControllerModelKeyMSFT                    modelKey,
    XrControllerModelPropertiesMSFT*            properties);
Description

The runtime must return the same data in XrControllerModelPropertiesMSFT for a valid modelKey. Therefore, the application can cache the returned XrControllerModelPropertiesMSFT using modelKey and reuse the data for each frame.

If the input modelKey is invalid, i.e. it is NULL_CONTROLLER_MODEL_KEY_MSFT or not a key returned from XrControllerModelKeyStateMSFT, the runtime must return ERROR_CONTROLLER_MODEL_KEY_INVALID_MSFT.

Valid Usage (Implicit)
Return Codes
On success, this command returns
On failure, this command returns
See Also

XrControllerModelPropertiesMSFT

Parameters
session:XrSession

the specified XrSession.

modelKey:long

a valid model key obtained from XrControllerModelKeyStateMSFT

properties:XrControllerModelPropertiesMSFT

an XrControllerModelPropertiesMSFT returning the properties of the controller model

Annotations
@NativeType:XrResult
xrGetControllerModelStateMSFTback to summary
public static int xrGetControllerModelStateMSFT(XrSession session, long modelKey, XrControllerModelStateMSFT state)

Get controller model state.

C Specification

The GetControllerModelStateMSFT function returns the current state of the controller model representing user’s interaction to the controller, such as pressing a button or pulling a trigger.


XrResult xrGetControllerModelStateMSFT(
    XrSession                                   session,
    XrControllerModelKeyMSFT                    modelKey,
    XrControllerModelStateMSFT*                 state);
Description

The runtime may return different state for a model key after each call to SyncActions, which represents the latest state of the user interactions.

If the input modelKey is invalid, i.e. it is NULL_CONTROLLER_MODEL_KEY_MSFT or not a key returned from XrControllerModelKeyStateMSFT, the runtime must return ERROR_CONTROLLER_MODEL_KEY_INVALID_MSFT.

Valid Usage (Implicit)
Return Codes
On success, this command returns
On failure, this command returns
See Also

XrControllerModelStateMSFT

Parameters
session:XrSession

the specified XrSession.

modelKey:long

the model key corresponding to the controller model being queried.

state:XrControllerModelStateMSFT

a pointer to XrControllerModelNodeStateMSFT returns the current controller model state.

Annotations
@NativeType:XrResult
xrLoadControllerModelMSFTback to summary
public static int xrLoadControllerModelMSFT(XrSession session, long modelKey, IntBuffer bufferCountOutput, ByteBuffer buffer)

Load controller render model.

C Specification

The LoadControllerModelMSFT function loads the controller model as a byte buffer containing a binary form of glTF (a.k.a GLB file format) for the controller. The binary glTF data must conform to glTF 2.0 format defined at {uri-msft-gltf2}.


XrResult xrLoadControllerModelMSFT(
    XrSession                                   session,
    XrControllerModelKeyMSFT                    modelKey,
    uint32_t                                    bufferCapacityInput,
    uint32_t*                                   bufferCountOutput,
    uint8_t*                                    buffer);
Description

The LoadControllerModelMSFT function may be a slow operation and therefore should be invoked from a non-timing critical thread.

If the input modelKey is invalid, i.e. it is NULL_CONTROLLER_MODEL_KEY_MSFT or not a key returned from XrControllerModelKeyStateMSFT, the runtime must return ERROR_CONTROLLER_MODEL_KEY_INVALID_MSFT.

Valid Usage (Implicit)
  • The XR_MSFT_controller_model extension must be enabled prior to calling LoadControllerModelMSFT
  • session must be a valid XrSession handle
  • bufferCountOutput must be a pointer to a uint32_t value
  • If bufferCapacityInput is not 0, buffer must be a pointer to an array of bufferCapacityInput uint8_t values
Return Codes
On success, this command returns
On failure, this command returns
Parameters
session:XrSession

the specified XrSession.

modelKey:long

the model key corresponding to the controller render model being queried.

bufferCountOutput:IntBuffer

filled in by the runtime with the count of elements in buffer array, or returns the required capacity in the case that bufferCapacityInput is insufficient.

buffer:ByteBuffer

a pointer to an application-allocated array of the model for the device that will be filled with the uint8_t values by the runtime. It can be NULL if bufferCapacityInput is 0.

Annotations
@NativeType:XrResult