![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <IXRTrackingSystem.h>
Inheritance diagram for IXRTrackingSystem:Static Public Member Functions | |
| static FName | GetModularFeatureName () |
Static Public Attributes | |
| static constexpr int32 | HMDDeviceId = 0 |
Main access point to an XR tracking system. Use it to enumerate devices and query their poses.
|
inlinevirtual |
Called to calibrate the offset transform between an external tracking source and the internal tracking source (e.g. mocap tracker to and HMD tracker). This should be called once per session, or when the physical relationship between the external tracker and internal tracker changes (e.g. it was bumped or reattached). After calibration, calling UpdateExternalTrackingPosition will try to correct the internal tracker to the calibrated offset to prevent drift between the two systems
| ExternalTrackingTransform | (in) The transform in world-coordinates, of the reference marker of the external tracking system |
|
inlinevirtual |
|
pure virtual |
Get the count of tracked devices
| Type | Optionally limit the count to a certain type |
Return true if the default camera implementation should query the current projection matrix at the start of the render frame and apply late update. In order to support late update, the plugin should refresh the current projection matrix just before rendering starts. A good point to insert the update is in OnBeginRendering_GameThread or OnBeginRendering_RenderThread.
Note that late projection update isn't compatible with all XR implementations because of projection matrix fetch restrictions.
Return true if the default camera implementation should query the current pose at the start of the render frame and apply late update. In order to support late update, the plugin should refresh the current pose just before rendering starts. A good point to insert the update is in OnBeginRendering_GameThread or OnBeginRendering_RenderThread.
Note that for backwards compatibility with plugins written before 4.19, this method defaults to returning 'true'
Whether or not the system supports positional tracking (either via sensor or other means)
|
pure virtual |
Reports all devices currently available to the system, optionally limiting the result to a given class of devices.
| OutDevices | The device ids of available devices will be appended to this array. |
| Type | Optionally limit the list of devices to a certain type. |
|
inlinevirtual |
Access optionsal ARCompositionComponent
|
inlinevirtual |
|
inlinevirtual |
Get the offset, in device space, of the reported device (screen / eye) position to the center of the head.
Returns current base orientation of HMD as a quaternion.
Returns current base position of HMD.
Returns current base orientation of HMD as yaw-pitch-roll combination.
|
pure virtual |
|
pure virtual |
Get the current pose for a device. This method must be callable both on the render thread and the game thread. For devices that don't support positional tracking, OutPosition will be at the base position.
| DeviceId | the device to request the pose for. |
| OutOrientation | The current orientation of the device |
| OutPosition | The current position of the device |
|
pure virtual |
Computes a transform to convert from 'Floor' origin space to 'Eye' origin space. Useful when changing between the two different TrackingOrigin spaces. Invert the transform to get the opposite.
| OutFloorToEye | [out] The returned floor-to-eye transform. |
|
pure virtual |
|
virtual |
Platform Agnostic Query about HMD details
|
inlinevirtual |
Access HMD rendering-related features.
|
inlinevirtual |
Get the IOpenXRHMD interface, if there is one.
|
inlinevirtual |
Access the loading screen interface associated with this tracking system, if any.
|
pure virtual |
Platform Agnostic Query about MotionControllers details
|
inlinevirtual |
Get the bounds of the area where the user can freely move while remaining tracked centered around the specified origin
|
inlinevirtual |
Get the transform and dimensions of the area where the user can freely move while remaining tracked centered around the specified origin transform
|
pure virtual |
If the device id represents a head mounted display, fetches the relative position of the given eye relative to the eye. If the device is does not represent a stereoscopic tracked camera, orientation and position should be identity and zero and the return value should be false.
| DeviceId | the device to request the eye pose for. |
| ViewIndex | the view the pose should be requested for, if passing in INDEX_NONE, the method should return a zero offset. |
| OutOrientation | The orientation of the eye relative to the device orientation. |
| OutPosition | The position of the eye relative to the tracked device |
|
inlinevirtual |
Access Stereo rendering device associated with this XR system. If GetHMDDevice() returns non-null, this method should also return a vaild instance.
|
pure virtual |
If the device id represents a tracking sensor, reports the serial number as a string if the device supports it.
| DeviceId | the device to request information for. |
|
pure virtual |
If the device id represents a tracking sensor, reports the device type.
| DeviceId | the device to request information for. |
|
pure virtual |
Returns current tracking origin.
|
inlinevirtual |
Get the transform of the specified tracking origin, if available.
|
pure virtual |
If the device id represents a tracking sensor, reports the frustum properties in game-world space of the sensor.
| DeviceId | the device to request information for. |
| OutOrientation | The current orientation of the device. |
| OutPosition | The current position of the device. |
| OutSensorProperties | A struct containing the tracking sensor properties. |
|
pure virtual |
Returns the system's latest known tracking-to-world transform. Useful for translating poses from GetCurrentPose() into unreal world space.
|
pure virtual |
Returns version string.
This method should return the world to meters scale for the current frame. Should be callable on both the render and the game threads.
|
pure virtual |
Get the IXCamera instance for the given device.
| DeviceId | the device the camera should track. |
Deprecated, and will be removed in a future release.
Access optional HMD input override interface.
Returns device specific flags.
If the system currently has valid tracking positions. If not supported at all, returns false.
Returns true, if head tracking is allowed. Most common case: it returns true when GEngine->IsStereoscopic3D() is true, but some overrides are possible.
Same as IsHeadTrackingAllowed, but returns false if the World is not using VR (such as with the non-VR PIE instances when using VR Preview)
Can be used to enforce tracking even when stereo rendering is disabled. The default implementation does not allow enforcing tracking and always returns false. This method is called both from the game and render threads.
Check current tracking status of a device.
| DeviceId | the device to request status for. |
|
inlinevirtual |
This method is called when playing begins. Useful to reset all runtime values stored in the plugin.
Called just before rendering the current frame on the game frame.
|
inlinevirtual |
|
virtual |
|
inlinefinalvirtual |
Called just before rendering the current frame on the render thread. Invoked before applying late update, so plugins that want to refresh poses on the render thread prior to late update. Use this to perform any initializations prior to rendering.
|
inlinevirtual |
This method is called when game frame ends (called on a game thread).
|
inlinevirtual |
This method is called when playing ends. Useful to reset all runtime values stored in the plugin.
|
virtual |
|
inlinefinalvirtual |
Called just after the late update on the render thread passing back the current relative transform.
|
inlinevirtual |
This method is called when new game frame begins (called on a game thread).
|
inlinevirtual |
Temporary method until Morpheus controller code has been refactored.
Resets orientation by setting roll and pitch to 0, assuming that current yaw is forward direction. Position is not changed.
| Yaw | (in) the desired yaw to be set after orientation reset. |
Resets orientation by setting roll and pitch to 0, assuming that current yaw is forward direction and assuming current position as a 'zero-point' (for positional tracking).
| Yaw | (in) the desired yaw to be set after orientation reset. |
Resets position, assuming current position as a 'zero-point'.
Sets base orientation, assuming that this is forward direction. Position is not changed.
| BaseOrient | (in) the desired orientation to be treated as a base orientation. |
Sets base position of the HMD.
| BasePosition | (in) the desired offset to be treated as a base position. |
Sets base orientation by setting yaw, pitch, roll, assuming that this is forward direction. Position is not changed.
| BaseRot | (in) the desired orientation to be treated as a base orientation. |
Can be used to enforce tracking even when stereo rendering is disabled. The default implementation does not allow enforcing tracking and ignores the argument.
|
pure virtual |
Sets tracking origin (either 'eye'-level or 'floor'-level).
|
inlinevirtual |
Called after calibration to attempt to pull the internal tracker (e.g. HMD tracking) in line with the external tracker (e.g. mocap tracker). This will set the internal tracker's base offset and rotation to match and realign the two systems. This can be called every tick, or whenever realignment is desired. Note that this may cause choppy movement if the two systems diverge relative to each other, or a big jump if called infrequently when there has been significant drift
| ExternalTrackingTransform | (in) The transform in world-coordinates, of the reference marker of the external tracking system |
|
pure virtual |
Refreshes the system's known tracking-to-world transform. Helpful for clients if they change the world's representation of the XR origin, or if they want to override the system calculated transform - calling this will update the known transform returned by GetTrackingToWorldTransform().
|
staticconstexpr |
Device id 0 is reserved for an HMD. This should represent the HMD or the first HMD in case multiple HMDs are supported. Other devices can have arbitrary ids defined by each system. If a tracking system does not support tracking HMDs, device ID zero should be treated as invalid.