engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 静态 Public 属性 | 所有成员列表
IXRTrackingSystem类 参考abstract

Main access point to an XR tracking system. 更多...

#include <IXRTrackingSystem.h>

+ 类 IXRTrackingSystem 继承关系图:

Public 成员函数

virtual void CalibrateExternalTrackingSource (const FTransform &ExternalTrackingTransform)
 Called to calibrate the offset transform between an external tracking source and the internal tracking source (e.g. 更多...
 
virtual uint32 CountTrackedDevices (EXRTrackedDeviceType Type=EXRTrackedDeviceType::Any)=0
 Get the count of tracked devices 更多...
 
virtual bool DoesSupportLateUpdate () const
 Return true if the default camera implementation should query the current pose at the start of the render frame and apply late update. 更多...
 
virtual bool DoesSupportPositionalTracking () const =0
 Whether or not the system supports positional tracking (either via sensor or other means)
 
virtual bool EnumerateTrackedDevices (TArray< int32 > &OutDevices, EXRTrackedDeviceType Type=EXRTrackedDeviceType::Any)=0
 Reports all devices currently available to the system, optionally limiting the result to a given class of devices. 更多...
 
virtual FVector GetAudioListenerOffset (int32 DeviceId=HMDDeviceId) const
 Get the offset, in device space, of the reported device (screen / eye) position to the center of the head. 更多...
 
virtual FQuat GetBaseOrientation () const
 Returns current base orientation of HMD as a quaternion.
 
virtual FVector GetBasePosition () const
 Returns current base position of HMD.
 
virtual FRotator GetBaseRotation () const
 Returns current base orientation of HMD as yaw-pitch-roll combination.
 
virtual bool GetCurrentPose (int32 DeviceId, FQuat &OutOrientation, FVector &OutPosition)=0
 Get the current pose for a device. 更多...
 
virtual bool GetFloorToEyeTrackingTransform (FTransform &OutFloorToEye) const =0
 Computes a transform to convert from 'Floor' origin space to 'Eye' origin space. 更多...
 
virtual void GetHMDData (UObject *WorldContext, FXRHMDData &HMDData)
 Platform Agnostic Query about HMD details
 
virtual class IHeadMountedDisplay * GetHMDDevice ()
 Access HMD rendering-related features. 更多...
 
virtual class IXRLoadingScreen * GetLoadingScreen ()
 Access the loading screen interface associated with this tracking system, if any. 更多...
 
virtual void GetMotionControllerData (UObject *WorldContext, const EControllerHand Hand, FXRMotionControllerData &MotionControllerData)=0
 Platform Agnostic Query about MotionControllers details
 
virtual bool GetRelativeEyePose (int32 DeviceId, EStereoscopicPass Eye, FQuat &OutOrientation, FVector &OutPosition)=0
 If the device id represents a head mounted display, fetches the relative position of the given eye relative to the eye. 更多...
 
virtual class TSharedPtr< class IStereoRendering, ESPMode::ThreadSafe > GetStereoRenderingDevice ()
 Access Stereo rendering device associated with this XR system. 更多...
 
virtual FString GetTrackedDevicePropertySerialNumber (int32 DeviceId)=0
 If the device id represents a tracking sensor, reports the serial number as a string if the device supports it. 更多...
 
virtual EXRTrackedDeviceType GetTrackedDeviceType (int32 DeviceId) const =0
 If the device id represents a tracking sensor, reports the device type. 更多...
 
virtual EHMDTrackingOrigin::Type GetTrackingOrigin () const =0
 Returns current tracking origin.
 
virtual bool GetTrackingSensorProperties (int32 DeviceId, FQuat &OutOrientation, FVector &OutPosition, FXRSensorProperties &OutSensorProperties)=0
 If the device id represents a tracking sensor, reports the frustum properties in game-world space of the sensor. 更多...
 
virtual FTransform GetTrackingToWorldTransform () const =0
 Returns the system's latest known tracking-to-world transform. 更多...
 
virtual FString GetVersionString () const =0
 Returns version string.
 
virtual float GetWorldToMetersScale () const =0
 This method should return the world to meters scale for the current frame. 更多...
 
virtual class TSharedPtr< class IXRCamera, ESPMode::ThreadSafe > GetXRCamera (int32 DeviceId=HMDDeviceId)=0
 Get the IXCamera instance for the given device. 更多...
 
virtual IXRInput * GetXRInput ()
 Access optional HMD input override interface. 更多...
 
virtual int32 GetXRSystemFlags () const =0
 Returns device specific flags.
 
virtual bool HasValidTrackingPosition ()=0
 If the system currently has valid tracking positions. 更多...
 
virtual bool IsHeadTrackingAllowed () const =0
 Returns true, if head tracking is allowed. 更多...
 
virtual bool IsHeadTrackingAllowedForWorld (UWorld &World) const
 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)
 
virtual bool IsHeadTrackingEnforced () const
 Can be used to enforce tracking even when stereo rendering is disabled. 更多...
 
virtual bool IsTracking (int32 DeviceId)=0
 Check current tracking status of a device. 更多...
 
virtual void OnBeginPlay (FWorldContext &InWorldContext)
 This method is called when playing begins. 更多...
 
virtual void OnBeginRendering_GameThread ()
 Called just before rendering the current frame on the game frame.
 
virtual void OnBeginRendering_RenderThread (FRHICommandListImmediate &RHICmdList, FSceneViewFamily &ViewFamily)
 Called just before rendering the current frame on the render thread. 更多...
 
virtual bool OnEndGameFrame (FWorldContext &WorldContext)
 This method is called when game frame ends (called on a game thread).
 
virtual void OnEndPlay (FWorldContext &InWorldContext)
 This method is called when playing ends. 更多...
 
virtual void OnLateUpdateApplied_RenderThread (const FTransform &NewRelativeTransform)
 Called just after the late update on the render thread passing back the current relative transform.
 
virtual bool OnStartGameFrame (FWorldContext &WorldContext)
 This method is called when new game frame begins (called on a game thread).
 
virtual void RebaseObjectOrientationAndPosition (FVector &Position, FQuat &Orientation) const
 Temporary method until Morpheus controller code has been refactored.
 
virtual void RefreshPoses ()
 Refresh poses. 更多...
 
virtual void ResetOrientation (float Yaw=0.f)
 Resets orientation by setting roll and pitch to 0, assuming that current yaw is forward direction. 更多...
 
virtual void ResetOrientationAndPosition (float Yaw=0.f)=0
 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). 更多...
 
virtual void ResetPosition ()
 Resets position, assuming current position as a 'zero-point'.
 
virtual void SetBaseOrientation (const FQuat &BaseOrient)
 Sets base orientation, assuming that this is forward direction. 更多...
 
virtual void SetBasePosition (const FVector &BasePosition)
 Sets base position of the HMD. 更多...
 
virtual void SetBaseRotation (const FRotator &BaseRot)
 Sets base orientation by setting yaw, pitch, roll, assuming that this is forward direction. 更多...
 
virtual void SetHeadTrackingEnforced (bool bEnabled)
 Can be used to enforce tracking even when stereo rendering is disabled. 更多...
 
virtual void SetTrackingOrigin (EHMDTrackingOrigin::Type NewOrigin)=0
 Sets tracking origin (either 'eye'-level or 'floor'-level).
 
virtual void UpdateExternalTrackingPosition (const FTransform &ExternalTrackingTransform)
 Called after calibration to attempt to pull the internal tracker (e.g. 更多...
 
virtual void UpdateTrackingToWorldTransform (const FTransform &TrackingToWorldOverride)=0
 Refreshes the system's known tracking-to-world transform. 更多...
 

静态 Public 属性

static const int32 HMDDeviceId = 0
 Device id 0 is reserved for an HMD. 更多...
 

详细描述

Main access point to an XR tracking system.

Use it to enumerate devices and query their poses.

成员函数说明

◆ CalibrateExternalTrackingSource()

virtual void IXRTrackingSystem::CalibrateExternalTrackingSource ( const FTransform &  ExternalTrackingTransform)
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

被 FXRTrackingSystemBase 重载.

◆ CountTrackedDevices()

virtual uint32 IXRTrackingSystem::CountTrackedDevices ( EXRTrackedDeviceType  Type = EXRTrackedDeviceType::Any)
pure virtual

Get the count of tracked devices

参数
TypeOptionally limit the count to a certain type
返回
the count of matching tracked devices

在 FXRTrackingSystemBase 内被实现.

◆ DoesSupportLateUpdate()

virtual bool IXRTrackingSystem::DoesSupportLateUpdate ( ) const
inlinevirtual

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'

◆ EnumerateTrackedDevices()

virtual bool IXRTrackingSystem::EnumerateTrackedDevices ( TArray< int32 > &  OutDevices,
EXRTrackedDeviceType  Type = EXRTrackedDeviceType::Any 
)
pure virtual

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

参数
OutDevicesThe device ids of available devices will be appended to this array.
TypeOptionally limit the list of devices to a certain type.

◆ GetAudioListenerOffset()

virtual FVector IXRTrackingSystem::GetAudioListenerOffset ( int32  DeviceId = HMDDeviceId) const
inlinevirtual

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

返回
a vector containing the offset coordinates, ZeroVector if not supported.

◆ GetCurrentPose()

virtual bool IXRTrackingSystem::GetCurrentPose ( int32  DeviceId,
FQuat &  OutOrientation,
FVector &  OutPosition 
)
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.

参数
DeviceIdthe device to request the pose for.
OutOrientationThe current orientation of the device
OutPositionThe current position of the device
返回
true if the pose is valid or not.

◆ GetFloorToEyeTrackingTransform()

virtual bool IXRTrackingSystem::GetFloorToEyeTrackingTransform ( FTransform &  OutFloorToEye) const
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.
返回
True if the transform was successfully constructed.

在 FXRTrackingSystemBase 内被实现.

◆ GetHMDDevice()

virtual class IHeadMountedDisplay * IXRTrackingSystem::GetHMDDevice ( )
inlinevirtual

Access HMD rendering-related features.

返回
a IHeadmountedDisplay pointer or a nullptr if this tracking system does not support head mounted displays.

◆ GetLoadingScreen()

virtual class IXRLoadingScreen * IXRTrackingSystem::GetLoadingScreen ( )
inlinevirtual

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

返回
an IXRLoadingScreen pointer or a nullptr if this tracking system does not support loading screens.

被 FXRTrackingSystemBase 重载.

◆ GetRelativeEyePose()

virtual bool IXRTrackingSystem::GetRelativeEyePose ( int32  DeviceId,
EStereoscopicPass  Eye,
FQuat &  OutOrientation,
FVector &  OutPosition 
)
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.

参数
DeviceIdthe device to request the eye pose for.
Eyethe eye the pose should be requested for, if passing in any other value than eSSP_LEFT_EYE or eSSP_RIGHT_EYE, the method should return a zero offset.
OutOrientationThe orientation of the eye relative to the device orientation.
OutPositionThe position of the eye relative to the tracked device
返回
true if the pose is valid or not. If the device is not a stereoscopic device, return false.

在 FXRTrackingSystemBase 内被实现.

◆ GetStereoRenderingDevice()

virtual class TSharedPtr< class IStereoRendering, ESPMode::ThreadSafe > IXRTrackingSystem::GetStereoRenderingDevice ( )
inlinevirtual

Access Stereo rendering device associated with this XR system.

If GetHMDDevice() returns non-null, this method should also return a vaild instance.

返回
a IStereoRendering pointer or a nullptr if this tracking system does not support stereo rendering.

◆ GetTrackedDevicePropertySerialNumber()

virtual FString IXRTrackingSystem::GetTrackedDevicePropertySerialNumber ( int32  DeviceId)
pure virtual

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

参数
DeviceIdthe device to request information for.
返回
the serial number of the device if it's available.

在 FXRTrackingSystemBase 内被实现.

◆ GetTrackedDeviceType()

virtual EXRTrackedDeviceType IXRTrackingSystem::GetTrackedDeviceType ( int32  DeviceId) const
pure virtual

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

参数
DeviceIdthe device to request information for.
返回
the device type enum.

在 FXRTrackingSystemBase 内被实现.

◆ GetTrackingSensorProperties()

virtual bool IXRTrackingSystem::GetTrackingSensorProperties ( int32  DeviceId,
FQuat &  OutOrientation,
FVector &  OutPosition,
FXRSensorProperties &  OutSensorProperties 
)
pure virtual

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

参数
DeviceIdthe device to request information for.
OutOrientationThe current orientation of the device.
OutPositionThe current position of the device.
OutSensorPropertiesA struct containing the tracking sensor properties.
返回
true if the device tracking is valid and supports returning tracking sensor properties.

在 FXRTrackingSystemBase 内被实现.

◆ GetTrackingToWorldTransform()

virtual FTransform IXRTrackingSystem::GetTrackingToWorldTransform ( ) const
pure virtual

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

Useful for translating poses from GetCurrentPose() into unreal world space.

在 FXRTrackingSystemBase 内被实现.

◆ GetWorldToMetersScale()

virtual float IXRTrackingSystem::GetWorldToMetersScale ( ) const
pure virtual

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

Should be callable on both the render and the game threads.

返回
the current world to meter scale.

◆ GetXRCamera()

virtual class TSharedPtr< class IXRCamera, ESPMode::ThreadSafe > IXRTrackingSystem::GetXRCamera ( int32  DeviceId = HMDDeviceId)
pure virtual

Get the IXCamera instance for the given device.

参数
DeviceIdthe device the camera should track.
返回
a shared pointer to an IXRCamera.

在 FXRTrackingSystemBase 内被实现.

◆ GetXRInput()

virtual IXRInput * IXRTrackingSystem::GetXRInput ( )
inlinevirtual

Access optional HMD input override interface.

返回
a IXRInput pointer or a nullptr if not supported

◆ HasValidTrackingPosition()

virtual bool IXRTrackingSystem::HasValidTrackingPosition ( )
pure virtual

If the system currently has valid tracking positions.

If not supported at all, returns false.

在 FXRTrackingSystemBase 内被实现.

◆ IsHeadTrackingAllowed()

virtual bool IXRTrackingSystem::IsHeadTrackingAllowed ( ) const
pure virtual

Returns true, if head tracking is allowed.

Most common case: it returns true when GEngine->IsStereoscopic3D() is true, but some overrides are possible.

在 FHeadMountedDisplayBase 内被实现.

◆ IsHeadTrackingEnforced()

virtual bool IXRTrackingSystem::IsHeadTrackingEnforced ( ) const
inlinevirtual

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.

被 FHeadMountedDisplayBase 重载.

◆ IsTracking()

virtual bool IXRTrackingSystem::IsTracking ( int32  DeviceId)
pure virtual

Check current tracking status of a device.

参数
DeviceIdthe device to request status for.
返回
true if the system currently has valid tracking info for the given device ID.

在 FXRTrackingSystemBase 内被实现.

◆ OnBeginPlay()

virtual void IXRTrackingSystem::OnBeginPlay ( FWorldContext &  InWorldContext)
inlinevirtual

This method is called when playing begins.

Useful to reset all runtime values stored in the plugin.

◆ OnBeginRendering_RenderThread()

virtual void IXRTrackingSystem::OnBeginRendering_RenderThread ( FRHICommandListImmediate &  RHICmdList,
FSceneViewFamily &  ViewFamily 
)
inlinevirtual

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.

◆ OnEndPlay()

virtual void IXRTrackingSystem::OnEndPlay ( FWorldContext &  InWorldContext)
inlinevirtual

This method is called when playing ends.

Useful to reset all runtime values stored in the plugin.

◆ RefreshPoses()

virtual void IXRTrackingSystem::RefreshPoses ( )
inlinevirtual

Refresh poses.

Tells the system to update the poses for its tracked devices. May be called both from the game and the render thread.

◆ ResetOrientation()

virtual void IXRTrackingSystem::ResetOrientation ( float  Yaw = 0.f)
inlinevirtual

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.

◆ ResetOrientationAndPosition()

virtual void IXRTrackingSystem::ResetOrientationAndPosition ( float  Yaw = 0.f)
pure virtual

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.

◆ SetBaseOrientation()

virtual void IXRTrackingSystem::SetBaseOrientation ( const FQuat &  BaseOrient)
inlinevirtual

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.

◆ SetBasePosition()

virtual void IXRTrackingSystem::SetBasePosition ( const FVector &  BasePosition)
inlinevirtual

Sets base position of the HMD.

参数
BasePosition(in) the desired offset to be treated as a base position.

◆ SetBaseRotation()

virtual void IXRTrackingSystem::SetBaseRotation ( const FRotator &  BaseRot)
inlinevirtual

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.

◆ SetHeadTrackingEnforced()

virtual void IXRTrackingSystem::SetHeadTrackingEnforced ( bool  bEnabled)
inlinevirtual

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

The default implementation does not allow enforcing tracking and ignores the argument.

被 FHeadMountedDisplayBase 重载.

◆ UpdateExternalTrackingPosition()

virtual void IXRTrackingSystem::UpdateExternalTrackingPosition ( const FTransform &  ExternalTrackingTransform)
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

被 FXRTrackingSystemBase 重载.

◆ UpdateTrackingToWorldTransform()

virtual void IXRTrackingSystem::UpdateTrackingToWorldTransform ( const FTransform &  TrackingToWorldOverride)
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().

在 FXRTrackingSystemBase 内被实现.

类成员变量说明

◆ HMDDeviceId

const int32 IXRTrackingSystem::HMDDeviceId = 0
static

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.


该类的文档由以下文件生成: