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

Base utility class for implementations of the IXRTrackingSystem interface Contains helpers and default implementation of most abstract methods, so final implementations only need to override features that they support. 更多...

#include <XRTrackingSystemBase.h>

+ 类 FXRTrackingSystemBase 继承关系图:

Public 成员函数

virtual void CalibrateExternalTrackingSource (const FTransform &ExternalTrackingTransform) override
 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) override
 Get the count of tracked devices. 更多...
 
virtual bool DoesSupportPositionalTracking () const override
 Whether or not the system supports positional tracking (either via sensor or other means). 更多...
 
virtual bool GetFloorToEyeTrackingTransform (FTransform &OutFloorToEye) const override
 Returns a transform for converting from 'Floor' origin space to 'Eye' origin space. 更多...
 
virtual class IXRLoadingScreen * GetLoadingScreen () override final
 Access the loading screen interface associated with this tracking system, if any. 更多...
 
virtual void GetMotionControllerData (UObject *WorldContext, const EControllerHand Hand, FXRMotionControllerData &MotionControllerData) override
 Platform Agnostic Query about MotionControllers details
 
virtual bool GetRelativeEyePose (int32 DeviceId, EStereoscopicPass Eye, FQuat &OutOrientation, FVector &OutPosition) override
 If the device id represents a head mounted display, fetches the relative position of the given eye relative to the eye. 更多...
 
virtual FString GetTrackedDevicePropertySerialNumber (int32 DeviceId) override
 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 override
 If the device id represents a tracking sensor, reports the device type. 更多...
 
virtual EHMDTrackingOrigin::Type GetTrackingOrigin () const override
 Returns current tracking origin. 更多...
 
virtual bool GetTrackingSensorProperties (int32 DeviceId, FQuat &OutOrientation, FVector &OutPosition, FXRSensorProperties &OutSensorProperties) override
 If the device id represents a tracking sensor, reports the frustum properties in game-world space of the sensor. 更多...
 
virtual FTransform GetTrackingToWorldTransform () const override
 Returns the system's latest known tracking-to-world transform.
 
virtual FString GetVersionString () const
 Returns version string.
 
virtual TSharedPtr< class IXRCamera, ESPMode::ThreadSafe > GetXRCamera (int32 DeviceId=HMDDeviceId) override
 Get the IXCamera instance for the given device. 更多...
 
virtual bool HasValidTrackingPosition () override
 If the system currently has valid tracking positions. 更多...
 
virtual bool IsTracking (int32 DeviceId) override
 Check current tracking status of a device. 更多...
 
virtual void SetTrackingOrigin (EHMDTrackingOrigin::Type NewOrigin) override
 Sets tracking origin (either 'eye'-level or 'floor'-level). 更多...
 
virtual void UpdateExternalTrackingPosition (const FTransform &ExternalTrackingTransform) override
 Called after calibration to attempt to pull the internal tracker (e.g. 更多...
 
virtual void UpdateTrackingToWorldTransform (const FTransform &TrackingToWorldOverride) override
 Refreshes the system's known tracking-to-world transform.
 
- Public 成员函数 继承自 IXRTrackingSystem
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. 更多...
 

Protected 成员函数

virtual class IXRLoadingScreen * CreateLoadingScreen ()
 Override this method if you need to customize the IXRLoadingScreen implementation. 更多...
 
virtual void OnTrackingOriginChanged ()
 Meant to be called by sub-classes whenever the tracking origin is altered.
 
FTransform RefreshTrackingToWorldTransform (FWorldContext &WorldContext)
 Computes the project's tracking-to-world transform based off how the user has set up their camera system (assumes the camera is parented to the XR origin, and in turn uses that transform). 更多...
 

Protected 属性

FTransform CalibratedOffset
 If the tracker is trying to lock itself to an external tracking source for drift control, this stores the calibrated offset between the external tracking system and the internal tracking system (e.g. 更多...
 

额外继承的成员函数

- 静态 Public 属性 继承自 IXRTrackingSystem
static const int32 HMDDeviceId = 0
 Device id 0 is reserved for an HMD. 更多...
 

详细描述

Base utility class for implementations of the IXRTrackingSystem interface Contains helpers and default implementation of most abstract methods, so final implementations only need to override features that they support.

成员函数说明

◆ CalibrateExternalTrackingSource()

virtual void FXRTrackingSystemBase::CalibrateExternalTrackingSource ( const FTransform &  ExternalTrackingTransform)
overridevirtual

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

参数
ExternalTrackingTransformThe transform in world-coordinates, of the reference marker of the external tracking system

重载 IXRTrackingSystem .

◆ CountTrackedDevices()

virtual uint32 FXRTrackingSystemBase::CountTrackedDevices ( EXRTrackedDeviceType  Type = EXRTrackedDeviceType::Any)
overridevirtual

Get the count of tracked devices.

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

The default implementation calls EnumerateTrackedDevices and returns the number of elements added to the array.

实现了 IXRTrackingSystem.

◆ CreateLoadingScreen()

virtual class IXRLoadingScreen * FXRTrackingSystemBase::CreateLoadingScreen ( )
protectedvirtual

Override this method if you need to customize the IXRLoadingScreen implementation.

It will be called from GetLoadingScreen() if LoadingScreen is not valid

◆ DoesSupportPositionalTracking()

virtual bool FXRTrackingSystemBase::DoesSupportPositionalTracking ( ) const
inlineoverridevirtual

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

The default implementation always returns false, indicating that only rotational tracking is supported.

实现了 IXRTrackingSystem.

◆ GetFloorToEyeTrackingTransform()

virtual bool FXRTrackingSystemBase::GetFloorToEyeTrackingTransform ( FTransform &  OutFloorToEye) const
inlineoverridevirtual

Returns a transform for converting from 'Floor' origin space to 'Eye' origin space.

The default implementation always returns the identity.

实现了 IXRTrackingSystem.

◆ GetLoadingScreen()

virtual class IXRLoadingScreen * FXRTrackingSystemBase::GetLoadingScreen ( )
finaloverridevirtual

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.

重载 IXRTrackingSystem .

◆ GetRelativeEyePose()

virtual bool FXRTrackingSystemBase::GetRelativeEyePose ( int32  DeviceId,
EStereoscopicPass  Eye,
FQuat &  OutOrientation,
FVector &  OutPosition 
)
overridevirtual

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.

实现了 IXRTrackingSystem.

◆ GetTrackedDevicePropertySerialNumber()

virtual FString FXRTrackingSystemBase::GetTrackedDevicePropertySerialNumber ( int32  DeviceId)
inlineoverridevirtual

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.

实现了 IXRTrackingSystem.

◆ GetTrackedDeviceType()

virtual EXRTrackedDeviceType FXRTrackingSystemBase::GetTrackedDeviceType ( int32  DeviceId) const
inlineoverridevirtual

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

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

实现了 IXRTrackingSystem.

◆ GetTrackingOrigin()

virtual EHMDTrackingOrigin::Type FXRTrackingSystemBase::GetTrackingOrigin ( ) const
inlineoverridevirtual

Returns current tracking origin.

The default implementation always reports 'eye'-level tracking.

实现了 IXRTrackingSystem.

◆ GetTrackingSensorProperties()

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

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.

The default implementation returns false for all device ids.

实现了 IXRTrackingSystem.

◆ GetXRCamera()

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

Get the IXCamera instance for the given device.

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

The default implementation only supports a single IXRCamera for the HMD Device, returning a FDefaultXRCamera instance.

实现了 IXRTrackingSystem.

◆ HasValidTrackingPosition()

virtual bool FXRTrackingSystemBase::HasValidTrackingPosition ( )
inlineoverridevirtual

If the system currently has valid tracking positions.

If not supported at all, returns false. Defaults to calling DoesSupportPositionalTracking();

实现了 IXRTrackingSystem.

◆ IsTracking()

virtual bool FXRTrackingSystemBase::IsTracking ( int32  DeviceId)
overridevirtual

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.

The default implementation returns the result of calling GetCurrentPose(DeviceId, ...), ignoring the returned pose.

实现了 IXRTrackingSystem.

◆ RefreshTrackingToWorldTransform()

FTransform FXRTrackingSystemBase::RefreshTrackingToWorldTransform ( FWorldContext &  WorldContext)
protected

Computes the project's tracking-to-world transform based off how the user has set up their camera system (assumes the camera is parented to the XR origin, and in turn uses that transform).

Intended to be called from OnStartGameFrame()

◆ SetTrackingOrigin()

virtual void FXRTrackingSystemBase::SetTrackingOrigin ( EHMDTrackingOrigin::Type  NewOrigin)
inlineoverridevirtual

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

The default implementations simply ignores the origin value.

实现了 IXRTrackingSystem.

◆ UpdateExternalTrackingPosition()

virtual void FXRTrackingSystemBase::UpdateExternalTrackingPosition ( const FTransform &  ExternalTrackingTransform)
overridevirtual

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

参数
ExternalTrackingTransformThe transform in world-coordinates, of the reference marker of the external tracking system

重载 IXRTrackingSystem .

类成员变量说明

◆ CalibratedOffset

FTransform FXRTrackingSystemBase::CalibratedOffset
protected

If the tracker is trying to lock itself to an external tracking source for drift control, this stores the calibrated offset between the external tracking system and the internal tracking system (e.g.

a location from a mocap system tracker to the HMD's internal IMU). UpdateExternalTrackingPostion will attempt to normalize the internal tracking system to match this calibration when called.


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