IXRTrackingSystem

Main access point to an XR tracking system. Use it to enumerate devices and query their poses.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

HeadMountedDisplay

Header

/Engine/Source/Runtime/HeadMountedDisplay/Public/IXRTrackingSystem.h

Include

#include "IXRTrackingSystem.h"

Syntax

class IXRTrackingSystem :
    public IModularFeature,
    public IXRSystemIdentifier

Remarks

Main access point to an XR tracking system. Use it to enumerate devices and query their poses.

Functions

Name Description

Public function Virtual

void

 

CalibrateExternalTrackingSource

(
    const FTransform& ExternalTracking...
)

Called to calibrate the offset transform between an external tracking source and the internal tracking source (e.g. mocap tracker to and HMD tracker).

Public function

bool

 

ConfigureGestures

(
    const FXRGestureConfig& GestureCon...
)

Public function Virtual

EXRDeviceCon...

 

ConnectRemoteXRDevice

(
    const FString& IpAddress,
    const int32 BitRate
)

Public function

uint32

 

CountTrackedDevices

(
    EXRTrackedDeviceType Type
)

Get the count of tracked devices

Public function Virtual

void

 

DisconnectRemoteXRDevice()

Public function Virtual Const

bool

 

DoesSupportLateUpdate()

Return true if the default camera implementation should query the current pose at the start of the render frame and apply late update.

Public function Const

bool

 

DoesSupportPositionalTracking()

Whether or not the system supports positional tracking (either via sensor or other means)

Public function

bool

 

EnumerateTrackedDevices

(
    TArray< int32 >& OutDevices,
    EXRTrackedDeviceType Type
)

Reports all devices currently available to the system, optionally limiting the result to a given class of devices.

Public function Virtual Const

FVector

 

GetAudioListenerOffset

(
    int32 DeviceId
)

Get the offset, in device space, of the reported device (screen / eye) position to the center of the head.

Public function Virtual Const

FQuat

 

GetBaseOrientation()

Returns current base orientation of HMD as a quaternion.

Public function Virtual Const

FVector

 

GetBasePosition()

Returns current base position of HMD.

Public function Virtual Const

FRotator

 

GetBaseRotation()

Returns current base orientation of HMD as yaw-pitch-roll combination.

Public function

bool

 

GetCurrentPose

(
    int32 DeviceId,
    FQuat& OutOrientation,
    FVector& OutPosition
)

Get the current pose for a device.

Public function Const

bool

 

GetFloorToEyeTrackingTransform

(
    FTransform& OutFloorToEye
)

Computes a transform to convert from 'Floor' origin space to 'Eye' origin space.

Public function Virtual

void

 

GetHMDData

(
    UObject* WorldContext,
    FXRHMDData& HMDData
)

Platform Agnostic Query about HMD details

Public function Virtual

IHeadMounted...

 

GetHMDDevice()

Access HMD rendering-related features.

Public function Virtual

IXRLoadingSc...

 

GetLoadingScreen()

Access the loading screen interface associated with this tracking system, if any.

Public function Static

FName

 

GetModularFeatureName()

Public function

void

 

GetMotionControllerData

(
    UObject* WorldContext,
    const EControllerHand Hand,
    FXRMotionControllerData& MotionCon...
)

Platform Agnostic Query about MotionControllers details

Public function Virtual Const

FVector2D

 

GetPlayAreaBounds

(
    EHMDTrackingOrigin::Type Origin
)

Get the bounds of the area where the user can freely move while remaining tracked centered around the specified origin

Public function

bool

 

GetRelativeEyePose

(
    int32 DeviceId,
    EStereoscopicPass Eye,
    FQuat& OutOrientation,
    FVector& OutPosition
)

If the device id represents a head mounted display, fetches the relative position of the given eye relative to the eye.

Public function Virtual

TSharedPtr< ...

 

GetStereoRenderingDevice()

Access Stereo rendering device associated with this XR system.

Public function

FString

 

GetTrackedDevicePropertySerialNumber

(
    int32 DeviceId
)

If the device id represents a tracking sensor, reports the serial number as a string if the device supports it.

Public function Const

EXRTrackedDe...

 

GetTrackedDeviceType

(
    int32 DeviceId
)

If the device id represents a tracking sensor, reports the device type.

Public function Const

EHMDTracking...

 

GetTrackingOrigin()

Returns current tracking origin.

Public function

bool

 

GetTrackingSensorProperties

(
    int32 DeviceId,
    FQuat& OutOrientation,
    FVector& OutPosition,
    FXRSensorProperties& OutSensorProp...
)

If the device id represents a tracking sensor, reports the frustum properties in game-world space of the sensor.

Public function Const

FTransform

 

GetTrackingToWorldTransform()

Returns the system's latest known tracking-to-world transform.

Public function Const

FString

 

GetVersionString()

Returns version string.

Public function Const

float

 

GetWorldToMetersScale()

This method should return the world to meters scale for the current frame.

Public function

TSharedPtr< ...

 

GetXRCamera

(
    int32 DeviceId
)

Get the IXCamera instance for the given device.

Public function Virtual

IXRInput ...

 

GetXRInput()

Access optional HMD input override interface.

Public function Const

int32

 

GetXRSystemFlags()

Returns device specific flags.

Public function

bool

 

HasValidTrackingPosition()

If the system currently has valid tracking positions. If not supported at all, returns false.

Public function Const

bool

 

IsHeadTrackingAllowed()

Returns true, if head tracking is allowed.

Public function Virtual Const

bool

 

IsHeadTrackingAllowedForWorld

(
    UWorld& World
)

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)

Public function Virtual Const

bool

 

IsHeadTrackingEnforced()

Can be used to enforce tracking even when stereo rendering is disabled.

Public function

bool

 

IsTracking

(
    int32 DeviceId
)

Check current tracking status of a device.

Public function Virtual Const

bool

 

LateLatchingEnabled()

Return true if platform and HMD support late latching Please override to enable it.

Public function Virtual

void

 

OnBeginPlay

(
    FWorldContext& InWorldContext
)

This method is called when playing begins. Useful to reset all runtime values stored in the plugin.

Public function Virtual

void

 

OnBeginRendering_GameThread()

Called just before rendering the current frame on the game frame.

Public function Virtual

void

 

OnBeginRendering_RenderThread

(
    FRHICommandListImmediate& RHICmdLi...,
    FSceneViewFamily& ViewFamily
)

Called just before rendering the current frame on the render thread.

Public function Virtual

bool

 

OnEndGameFrame

(
    FWorldContext& WorldContext
)

This method is called when game frame ends (called on a game thread).

Public function Virtual

void

 

OnEndPlay

(
    FWorldContext& InWorldContext
)

This method is called when playing ends. Useful to reset all runtime values stored in the plugin.

Public function Virtual

void

 

OnLateUpdateApplied_RenderThread

(
    FRHICommandListImmediate& RHICmdLi...,
    const FTransform& NewRelativeTrans...
)

Called just after the late update on the render thread passing back the current relative transform.

Public function Virtual

bool

 

OnStartGameFrame

(
    FWorldContext& WorldContext
)

This method is called when new game frame begins (called on a game thread).

Public function Virtual Const

void

 

RebaseObjectOrientationAndPosition

(
    FVector& Position,
    FQuat& Orientation
)

Temporary method until Morpheus controller code has been refactored.

Public function Virtual

void

 

ResetOrientation

(
    float Yaw
)

Resets orientation by setting roll and pitch to 0, assuming that current yaw is forward direction.

Public function

void

 

ResetOrientationAndPosition

(
    float Yaw
)

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).

Public function Virtual

void

 

ResetPosition()

Resets position, assuming current position as a 'zero-point'.

Public function Virtual

void

 

SetBaseOrientation

(
    const FQuat& BaseOrient
)

Sets base orientation, assuming that this is forward direction. Position is not changed.

Public function Virtual

void

 

SetBasePosition

(
    const FVector& BasePosition
)

Sets base position of the HMD.

Public function Virtual

void

 

SetBaseRotation

(
    const FRotator& BaseRot
)

Sets base orientation by setting yaw, pitch, roll, assuming that this is forward direction.

Public function Virtual

void

 

SetHeadTrackingEnforced

(
    bool bEnabled
)

Can be used to enforce tracking even when stereo rendering is disabled.

Public function

void

 

SetTrackingOrigin

(
    EHMDTrackingOrigin::Type NewOrigin
)

Sets tracking origin (either 'eye'-level or 'floor'-level).

Public function Virtual

void

 

UpdateExternalTrackingPosition

(
    const FTransform& ExternalTracking...
)

Called after calibration to attempt to pull the internal tracker (e.g. HMD tracking) in line with the external tracker (e.g. mocap tracker).

Public function

void

 

UpdateTrackingToWorldTransform

(
    const FTransform& TrackingToWorldO...
)

Refreshes the system's known tracking-to-world transform.

Constants

Name

Description

HMDDeviceId

Device id 0 is reserved for an HMD.

Deprecated Functions

Name Description

Public function Virtual

void

 

RefreshPoses()

This functionality is no longer supported.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss