Navigation
API > API/Plugins > API/Plugins/XRBase > API/Plugins/XRBase/UHeadMountedDisplayFunctionLibra-
References
| Module | XRBase |
| Header | /Engine/Plugins/Runtime/XRBase/Source/XRBase/Public/HeadMountedDisplayFunctionLibrary.h |
| Include | #include "HeadMountedDisplayFunctionLibrary.h" |
| Source | /Engine/Plugins/Runtime/XRBase/Source/XRBase/Private/HeadMountedDisplayFunctionLibrary.cpp |
UFUNCTION&40;BlueprintCallable, Category&61;"Input&124;XRTracking",
Meta&61;&40;DeprecatedFunction, DeprecationMessage&61;"Use new GetControllerTransformForTime2 which represents angular velocity as an FRotator rather than in the non&45;standard way this function represented it."&41;&41;
static bool GetControllerTransformForTime
&40;
UObject &42; WorldContext,
const int32 ControllerIndex,
const FName MotionSource,
FTimespan Time,
bool & bTimeWasUsed,
FRotator & Orientation,
FVector & Position,
bool & bProvidedLinearVelocity,
FVector & LinearVelocity,
bool & bProvidedAngularVelocity,
FVector & AngularVelocityAsAxisAndLength,
bool & bProvidedLinearAcceleration,
FVector & LinearAcceleration
&41;
Remarks
Get the transform and potentially velocity data at a specified time near the current frame in unreal world space. This is intended for use with sub-frame input action timing data from SetXRTimedInputActionDelegate, or future support for timestamps in the core input system. The valid time window is platform dependent, but the intention per OpenXR is to fetch transforms for times from, at most, the previous few frames in the past or future. The OpenXR spec suggests that 50ms in the past should return an accurate result. There is no guarantee for the future, but the underlying system is likely to have been designed to predict out to about 50ms as well. On some platforms this will always just return a cached position and rotation, ignoring time. bTimeWasUsed will be false in that case.
AngularVelocityRadPerSec is a vector where direction is the axis of rotation and length is the speed of rotation in radians per second. Note that it is not difficult to rotate a controller at more than 0.5 or 1 rotation per second briefly and some mathmatical operations (such as conversion to quaternion) lose rotations beyond 180 degrees or 360 degrees. In some cases that is OK becuase the resulting final rotation is the same, but in some cases it would generate incorrect results.