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.
|
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 重载.
|
pure virtual |
Get the count of tracked devices
| Type | Optionally limit the count to a certain type |
在 FXRTrackingSystemBase 内被实现.
|
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'
|
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 |
Get the offset, in device space, of the reported device (screen / eye) position to the center of the head.
|
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. |
在 FXRTrackingSystemBase 内被实现.
|
inlinevirtual |
Access HMD rendering-related features.
|
inlinevirtual |
Access the loading screen interface associated with this tracking system, if any.
被 FXRTrackingSystemBase 重载.
|
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. |
| Eye | the 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. |
| OutOrientation | The orientation of the eye relative to the device orientation. |
| OutPosition | The position of the eye relative to the tracked device |
在 FXRTrackingSystemBase 内被实现.
|
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. |
在 FXRTrackingSystemBase 内被实现.
|
pure virtual |
If the device id represents a tracking sensor, reports the device type.
| DeviceId | the device to request information for. |
在 FXRTrackingSystemBase 内被实现.
|
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. |
在 FXRTrackingSystemBase 内被实现.
|
pure virtual |
Returns the system's latest known tracking-to-world transform.
Useful for translating poses from GetCurrentPose() into unreal world space.
在 FXRTrackingSystemBase 内被实现.
|
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.
|
pure virtual |
Get the IXCamera instance for the given device.
| DeviceId | the device the camera should track. |
在 FXRTrackingSystemBase 内被实现.
|
inlinevirtual |
Access optional HMD input override interface.
|
pure virtual |
If the system currently has valid tracking positions.
If not supported at all, returns false.
在 FXRTrackingSystemBase 内被实现.
|
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 内被实现.
|
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 重载.
|
pure virtual |
Check current tracking status of a device.
| DeviceId | the device to request status for. |
在 FXRTrackingSystemBase 内被实现.
|
inlinevirtual |
This method is called when playing begins.
Useful to reset all runtime values stored in the plugin.
|
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.
|
inlinevirtual |
This method is called when playing ends.
Useful to reset all runtime values stored in the plugin.
|
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.
|
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. |
|
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. |
|
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. |
|
inlinevirtual |
Sets base position of the HMD.
| BasePosition | (in) the desired offset to be treated as a base position. |
|
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. |
|
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 重载.
|
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 重载.
|
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 内被实现.
|
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.