Navigation
API > API/Plugins > API/Plugins/XRScribe
References
| Module | XRScribe |
| Header | /Engine/Plugins/Runtime/XR/XRScribe/Source/XRScribe/Public/XRScribeEmulatedPoseManager.h |
| Include | #include "XRScribeEmulatedPoseManager.h" |
Syntax
class FOpenXRActionPoseManager
Remarks
The ActionPoseManager has two primary jobs:
- ingest data from capture
- generate estimated poses/actions based on captured state + timings
When using the ActionPoseManager, we'll interact with it similarly to xrLocateSpace: give it time and spaces, and return locations. On the Action side, give it an action and sync time, and we return an action state.
Internally, we'll plan to have all managed poses in tracker-space, and convert to the different spaces as needed. This does mean we'll need to know how to convert between different spaces, even if the original capture might not tell us how to
Variables
| Type | Name | Description | |
|---|---|---|---|
| TMap< FName, TArray< FOpenXRLocateSpacePacket > > | ActionPoseHistories | ||
| TMap< FName, TArray< FOpenXRGetActionStateBooleanPacket > > | BooleanActionStateHistories | ||
| TMap< FName, FBooleanActionStateHistory > | BooleanProcessedHistories | ||
| TMap< FName, XrActionStateBoolean > | CachedEmulatedBooleanStates | ||
| TMap< FName, XrActionStateFloat > | CachedEmulatedFloatStates | ||
| TMap< FName, XrActionStateVector2f > | CachedEmulatedVector2fStates | ||
| TMap< XrAction, FOpenXRCreateActionPacket > | CapturedActions | ||
| TArray< FOpenXRCreateActionSpacePacket > | CapturedActionSpaces | ||
| TMap< XrPath, FName > | CapturedPaths | ||
| XrTime | CapturedRangeEnd | ||
| XrTime | CapturedRangeStart | ||
| TMap< XrAction, TArray< FOpenXRGetActionStateBooleanPacket > > | CapturedRawBooleanActionStates | TArray |
|
| TMap< XrAction, TArray< FOpenXRGetActionStateFloatPacket > > | CapturedRawFloatActionStates | ||
| TMap< XrAction, TArray< FOpenXRGetActionStatePosePacket > > | CapturedRawPoseActionStates | ||
| TMap< XrSpace, TArray< FOpenXRLocateSpacePacket > > | CapturedRawSpaceHistories | ||
| TMap< XrAction, TArray< FOpenXRGetActionStateVector2fPacket > > | CapturedRawVectorActionStates | ||
| TArray< FOpenXRCreateReferenceSpacePacket > | CapturedReferenceSpaces | Known spaces and relevant actions from capture. | |
| int64 | CapturedSliceCount | ||
| TMap< XrAction, FName > | EmulatedActionNames | ||
| TMap< XrSpace, FName > | EmulatedActionSpaceNameMap | ||
| XrTime | EmulatedBaseTime | ||
| TMap< XrPath, FName > | EmulatedPaths | ||
| TMap< XrSpace, XrReferenceSpaceType > | EmulatedReferenceSpaceTypeMap | Map of emulated spaces to their underlying reference space type (if applicable) | |
| TMap< FName, TArray< FOpenXRGetActionStateFloatPacket > > | FloatActionStateHistories | ||
| TMap< FName, FFloatActionStateHistory > | FloatProcessedHistories | ||
| TStaticArray< FrameTimeHistoryEntry, PoseHistorySize > | FrameTimeHistory | History of frame times, in order for pose manager to look into to estimate the relative frame index for times. | |
| int32 | LastInsertedFrameIndex | ||
| TMap< FName, TArray< FOpenXRGetActionStatePosePacket > > | PoseActionStateHistories | ||
| TMap< XrReferenceSpaceType, TArray< FOpenXRLocateSpacePacket > > | ReferencePoseHistories | Processed pose histories for space types, which could be unified across different space handles with the same underlying reference space type. | |
| TMap< FName, FVector2fActionStateHistory > | Vector2fProcessedHistories | ||
| TMap< FName, TArray< FOpenXRGetActionStateVector2fPacket > > | VectorActionStateHistories | ||
| TArray< FOpenXRWaitFramePacket > | WaitFrameHistory |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AddEmulatedFrameTime
(
XrTime Time, |
Add time and frame number in order to generate interpolated poses We use the frame numbers to index into a relative history of the poses, and the time for frame matching + interpolation, because LocateSpace calls only provide a time argument | |
| void | Helper function to determine full time range of capture | ||
| bool | DoesActionContainPoseHistory
(
TStaticArray< ANSICHAR, XR_MAX_ACTION_NAME_SIZE >& ActionName |
If we have a pose history for the action, then xrGetActionStatePose can tell the client that the action is active, and poses are ready to fetch | |
| bool | FilterSpaceHistory
(
const TArray< FOpenXRLocateSpacePacket >& RawHistory, |
Sort and remove duplicates in history for single space | |
| int64 | GenerateReplaySliceIndexFromTime
(
XrTime EmulatedTime |
Helper function to generate index into captured history from emulated time (offset from emulated session start) | |
| const XrActionStateBoolean | GetCachedEmulatedBooleanState
(
FName ActionName |
Helper function to managed 'cached' action states, because we're only supposed to update on state changes | |
| const XrActionStateFloat | GetCachedEmulatedFloatState
(
FName ActionName |
||
| const XrActionStateVector2f | GetCachedEmulatedVector2fState
(
FName ActionName |
||
| XrReferenceSpaceType | GetCapturedReferenceSpaceType
(
XrSpace CapturedSpace |
Helper function to fetch underlying reference space type from opaque XrSpace handle | |
| FName | GetEmulatedActionName
(
XrAction Action |
||
| XrActionStateBoolean | GetEmulatedActionStateBoolean
(
const XrActionStateGetInfo* GetInfo, |
Fetch an action state generated from the captured history, by using XrActionStateGetInfo and most recent sync time The function itself is used to designate between different action state histories (bool, float, vector2f). | |
| XrActionStateFloat | GetEmulatedActionStateFloat
(
const XrActionStateGetInfo* GetInfo, |
||
| XrActionStateVector2f | GetEmulatedActionStateVector2f
(
const XrActionStateGetInfo* GetInfo, |
||
| XrSpaceLocation | GetEmulatedPoseForTime
(
XrSpace LocatingSpace, |
Fetch a pose generated from the captured history, by using space handles and times generated by the emulated runtime | |
| void | Reset internal emulation state based on session teardown. | ||
| void | ProcessCapturedActionSpaceHistory
(
const TArray< FOpenXRLocateSpacePacket >& SpaceHistory |
||
| void | Process all captured pose and action state histories at once, in order to create a unified timeline | ||
| void | ProcessCapturedReferenceSpaceHistory
(
const TArray< FOpenXRLocateSpacePacket >& SpaceHistory |
||
| void | RegisterCapturedActions
(
const TArray< FOpenXRCreateActionPacket >& CreateActionPackets |
Register information about actions from capture file, in order to fetch action name for mapping between capture and emulation | |
| void | RegisterCapturedActionSpaces
(
const TArray< FOpenXRCreateActionSpacePacket >& CreateActionSpacePackets |
Register information about action spaces from capture file, which we need to build a history of space locations for XR devices | |
| void | RegisterCapturedActionStates
(
const TArray< FOpenXRSyncActionsPacket >& SyncActionsPackets, |
Register history of GetActionState + SyncActions calls | |
| void | RegisterCapturedPathStrings
(
const TMap< XrPath, FName >& PathStringMap |
Register information about paths to path strings from the capture | |
| void | RegisterCapturedReferenceSpaces
(
const TArray< FOpenXRCreateReferenceSpacePacket >& CreateReferenceSpacePackets |
Register information about reference spaces from a capture file, in order to build a history of space locations relative to those reference spaces. | |
| void | RegisterCapturedSpaceHistories
(
const TMap< XrSpace, TArray< FOpenXRLocateSpacePacket > >& SpaceHistories |
Register history of LocateSpace calls | |
| void | RegisterCapturedWaitFrames
(
const TArray< FOpenXRWaitFramePacket >& InWaitFrameHistory |
Register information about wait frames from a capture file, in order to build a history of display times | |
| void | RegisterEmulatedAction
(
FName ActionName, |
Register emulated action. | |
| void | RegisterEmulatedActionSpace
(
TStaticArray< ANSICHAR, XR_MAX_ACTION_NAME_SIZE >& ActionName, |
Register emulated action space. | |
| void | RegisterEmulatedPath
(
FName PathString, |
Register emulated path. Manager needs this to match paths between capture and emulation. | |
| void | RegisterEmulatedReferenceSpace
(
const XrReferenceSpaceCreateInfo& CreateInfo, |
Register emulated reference space. | |
| void | SetCachedEmulatedBooleanState
(
FName ActionName, |
||
| void | SetCachedEmulatedFloatState
(
FName ActionName, |
||
| void | SetCachedEmulatedVector2fState
(
FName ActionName, |
||
| TArray< FOpenXRLocateSpacePacket > | SliceFilteredSpaceHistory
(
const TArray< FOpenXRLocateSpacePacket >& FilteredHistory |
Resample the filtered history in order to ease reading poses back based on time offsets during emulation | |
| bool | ValidateSubpath
(
const TSet< FName >& ValidSubpaths, |
||
| bool | VerifyCapturedActionSpace
(
XrSpace CapturedSpace |
Helper function to validate captured space is an action space |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FrameTimeHistoryEntry | |||
| TActionState | |||
| TActionStateHistory |
Typedefs
| Name | Description |
|---|---|
| FBooleanActionState | |
| FBooleanActionStateHistory | |
| FFloatActionState | |
| FFloatActionStateHistory | |
| FVector2fActionState | |
| FVector2fActionStateHistory |
Constants
| Name | Description |
|---|---|
| PoseHistorySize | Number of poses the manager will keep available relative to 'current' pose, in order for multi-frame pose queries. |