Class HeadMountedDisplayFunctionLibrary
Head Mounted Display Function Library
Inherited Members
Namespace: UE4.HeadMountedDisplay
Assembly: UE4DotNet.dll
Syntax
public class HeadMountedDisplayFunctionLibrary : BlueprintFunctionLibrary
Properties
| Improve this Doc View SourceDefaultObject
Get UE4 Default Object for this Class
Declaration
public static HeadMountedDisplayFunctionLibrary DefaultObject { get; }
Property Value
Type | Description |
---|---|
HeadMountedDisplayFunctionLibrary |
StaticClass
Get UE4 Class
Declaration
public static Class StaticClass { get; }
Property Value
Type | Description |
---|---|
Class |
Methods
| Improve this Doc View SourceCalibrateExternalTrackingToHMD(Transform)
Called to calibrate the offset transform between an external tracking source and the internal tracking source (e.
Declaration
public static void CalibrateExternalTrackingToHMD(Transform ExternalTrackingTransform)
Parameters
Type | Name | Description |
---|---|---|
Transform | ExternalTrackingTransform |
Remarks
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
@param ExternalTrackingTransform The transform in world-coordinates, of the reference marker of the external tracking system
EnableHMD(Boolean)
Switches to/from using HMD and stereo rendering.
Declaration
public static bool EnableHMD(bool bEnable)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | bEnable |
Returns
Type | Description |
---|---|
System.Boolean |
Remarks
@param bEnable (in) 'true' to enable HMD / stereo; 'false' otherwise @return (Boolean) True, if the request was successful.
EnableLowPersistenceMode(Boolean)
Switches between low and full persistence modes.
Declaration
public static void EnableLowPersistenceMode(bool bEnable)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | bEnable |
Remarks
@param bEnable (in) 'true' to enable low persistence mode; 'false' otherwise
EnumerateTrackedDevices(Name, EXRTrackedDeviceType)
Cross XR-System query that will list all XR devices currently being tracked.
Declaration
public static IReadOnlyCollection<XRDeviceId> EnumerateTrackedDevices(Name SystemId, EXRTrackedDeviceType DeviceType)
Parameters
Type | Name | Description |
---|---|---|
Name | SystemId | |
EXRTrackedDeviceType | DeviceType |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyCollection<XRDeviceId> |
Remarks
@param SystemId (Optional) Specifies an explicit system to poll devices from (use if you want only devices belonging to one explicit XR ecosystem, e.g. 'OculusHMD', or 'SteamVR') @param DeviceType Specifies the type of device to query for - defaults to 'Any' (meaning 'All').
@return A list of device identifiers matching the query. Use these to query and operate on the device (e.g. through GetDevicePose, AddDeviceVisualizationComponent, etc.)
GetDevicePose(XRDeviceId)
Cross XR-System query that returns a specific device's tracked position and orientation (in tracking space).
Declaration
public static (bool, Rotator, bool, Vector) GetDevicePose(XRDeviceId XRDeviceId)
Parameters
Type | Name | Description |
---|---|---|
XRDeviceId | XRDeviceId |
Returns
Type | Description |
---|---|
System.ValueTuple<System.Boolean, Rotator, System.Boolean, Vector> |
Remarks
@param XRDeviceId Specifies the device you're querying for. @param bIsTracked [out] Details if the specified device is tracked (i.e. should the rest of the outputs be used) @param Orientation [out] Represents the device's current rotation - NOTE: this value is not late updated and will be behind the render thread @param bHasPositionalTracking [out] Details if the specified device has positional tracking (i.e. if the position output should be used) @param Position [out] Represents the device's current position - NOTE: this value is not late updated and will be behind the render thread
GetDeviceWorldPose(UObject, XRDeviceId)
Cross XR-System query that returns a specific device's position and orientation in world space.
Declaration
public static (bool, Rotator, bool, Vector) GetDeviceWorldPose(UObject WorldContext, XRDeviceId XRDeviceId)
Parameters
Type | Name | Description |
---|---|---|
UObject | WorldContext | |
XRDeviceId | XRDeviceId |
Returns
Type | Description |
---|---|
System.ValueTuple<System.Boolean, Rotator, System.Boolean, Vector> |
Remarks
@param XRDeviceId Specifies the device you're querying for. @param bIsTracked [out] Details if the specified device is tracked (i.e. should the rest of the outputs be used) @param Orientation [out] Represents the device's current rotation - NOTE: this value is not late updated and will be behind the render thread @param bHasPositionalTracking [out] Details if the specified device has positional tracking (i.e. if the position output should be used) @param Position [out] Represents the device's current position - NOTE: this value is not late updated and will be behind the render thread
GetHMDDeviceName()
Returns the name of the device, so scripts can modify their behaviour appropriately @
Declaration
public static Name GetHMDDeviceName()
Returns
Type | Description |
---|---|
Name |
Remarks
return FName specific to the currently active HMD device type. "None" implies no device, "Unknown" implies a device with no description.
GetHMDWornState()
Returns the worn state of the device.
Declaration
public static byte GetHMDWornState()
Returns
Type | Description |
---|---|
System.Byte |
Remarks
@return Unknown, Worn, NotWorn. If the platform does not detect this it will always return Unknown.
GetNumOfTrackingSensors()
If the HMD has multiple positional tracking sensors, return a total number of them currently connected.
Declaration
public static int GetNumOfTrackingSensors()
Returns
Type | Description |
---|---|
System.Int32 |
GetOrientationAndPosition()
Grabs the current orientation and position for the HMD.
Declaration
public static (Rotator, Vector) GetOrientationAndPosition()
Returns
Type | Description |
---|---|
System.ValueTuple<Rotator, Vector> |
Remarks
If positional tracking is not available, DevicePosition will be a zero vector
@param DeviceRotation (out) The device's current rotation @param DevicePosition (out) The device's current position, in its own tracking space
GetPixelDensity()
Returns the current VR pixel density.
Declaration
public static float GetPixelDensity()
Returns
Type | Description |
---|---|
System.Single |
Remarks
Pixel density sets the VR render target texture size as a factor of recommended texture size. The recommended texture size is the size that will result in no under sampling in most distorted area of the view when computing the final image to be displayed on the device by the runtime compositor.
@return (float) The pixel density to be used in VR mode.
GetPositionalTrackingCameraParameters()
If the HMD has a positional sensor, this will return the game-world location of it, as well as the parameters for the bounding region of tracking.
Declaration
public static (Vector, Rotator, float, float, float, float, float) GetPositionalTrackingCameraParameters()
Returns
Type | Description |
---|---|
System.ValueTuple<Vector, Rotator, System.Single, System.Single, System.Single, System.Single, System.Single> |
Remarks
This allows an in-game representation of the legal positional tracking range. All values will be zeroed if the sensor is not available or the HMD does not support it.
@param Origin (out) Origin, in world-space, of the sensor @param Rotation (out) Rotation, in world-space, of the sensor @param HFOV (out) Field-of-view, horizontal, in degrees, of the valid tracking zone of the sensor @param VFOV (out) Field-of-view, vertical, in degrees, of the valid tracking zone of the sensor @param CameraDistance (out) Nominal distance to sensor, in world-space @param NearPlane (out) Near plane distance of the tracking volume, in world-space @param FarPlane (out) Far plane distance of the tracking volume, in world-space
GetScreenPercentage()
Get Screen Percentage
Declaration
public static float GetScreenPercentage()
Returns
Type | Description |
---|---|
System.Single |
GetTrackingOrigin()
Returns current tracking origin type (eye level or floor level).
Declaration
public static byte GetTrackingOrigin()
Returns
Type | Description |
---|---|
System.Byte |
GetTrackingSensorParameters(Int32)
If the HMD has a positional sensor, this will return the game-world location of it, as well as the parameters for the bounding region of tracking.
Declaration
public static (Vector, Rotator, float, float, float, float, float, float, float, bool) GetTrackingSensorParameters(int Index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | Index |
Returns
Type | Description |
---|---|
System.ValueTuple<Vector, Rotator, System.Single, System.Single, System.Single, System.Single, System.Single, System.ValueTuple<System.Single, System.Single, System.Boolean>> |
Remarks
This allows an in-game representation of the legal positional tracking range. All values will be zeroed if the sensor is not available or the HMD does not support it.
@param Index (in) Index of the tracking sensor to query @param Origin (out) Origin, in world-space, of the sensor @param Rotation (out) Rotation, in world-space, of the sensor @param LeftFOV (out) Field-of-view, left from center, in degrees, of the valid tracking zone of the sensor @param RightFOV (out) Field-of-view, right from center, in degrees, of the valid tracking zone of the sensor @param TopFOV (out) Field-of-view, top from center, in degrees, of the valid tracking zone of the sensor @param BottomFOV (out) Field-of-view, bottom from center, in degrees, of the valid tracking zone of the sensor @param Distance (out) Nominal distance to sensor, in world-space @param NearPlane (out) Near plane distance of the tracking volume, in world-space @param FarPlane (out) Far plane distance of the tracking volume, in world-space @param IsActive (out) True, if the query for the specified sensor succeeded.
GetTrackingToWorldTransform(UObject)
Returns a transform that can be used to convert points from tracking space to world space.
Declaration
public static Transform GetTrackingToWorldTransform(UObject WorldContext)
Parameters
Type | Name | Description |
---|---|---|
UObject | WorldContext |
Returns
Type | Description |
---|---|
Transform |
Remarks
Does NOT include the set WorldToMeters scale, as that is added in by the backing XR system to their tracking space poses.
GetVRFocusState()
Returns current state of VR focus.
Declaration
public static (bool, bool) GetVRFocusState()
Returns
Type | Description |
---|---|
System.ValueTuple<System.Boolean, System.Boolean> |
Remarks
@param bUseFocus (out) if set to true, then this App does use VR focus. @param bHasFocus (out) if set to true, then this App currently has VR focus.
GetWorldToMetersScale(UObject)
Returns the World to Meters scale, which corresponds to the scale of the world as perceived by the player @
Declaration
public static float GetWorldToMetersScale(UObject WorldContext)
Parameters
Type | Name | Description |
---|---|---|
UObject | WorldContext |
Returns
Type | Description |
---|---|
System.Single |
Remarks
return How many Unreal units correspond to one meter in the real world
HasValidTrackingPosition()
If the HMD supports positional tracking, whether or not we are currently being tracked
Declaration
public static bool HasValidTrackingPosition()
Returns
Type | Description |
---|---|
System.Boolean |
IsDeviceTracking(XRDeviceId)
Cross XR-System query that returns whether the specified device is tracked or not.
Declaration
public static bool IsDeviceTracking(XRDeviceId XRDeviceId)
Parameters
Type | Name | Description |
---|---|---|
XRDeviceId | XRDeviceId |
Returns
Type | Description |
---|---|
System.Boolean |
Remarks
@param XRDeviceId Specifies the device you're querying for.
IsHeadMountedDisplayConnected()
Returns whether or not the HMD hardware is connected and ready to use.
Declaration
public static bool IsHeadMountedDisplayConnected()
Returns
Type | Description |
---|---|
System.Boolean |
Remarks
It may or may not actually be in use.
@return (Boolean) status whether the HMD hardware is connected and ready to use. It may or may not actually be in use.
IsHeadMountedDisplayEnabled()
Returns whether or not we are currently using the head mounted display.
Declaration
public static bool IsHeadMountedDisplayEnabled()
Returns
Type | Description |
---|---|
System.Boolean |
Remarks
@return (Boolean) status of HMD
IsInLowPersistenceMode()
Returns true, if HMD is in low persistence mode. 'false' otherwise.
Declaration
public static bool IsInLowPersistenceMode()
Returns
Type | Description |
---|---|
System.Boolean |
IsSpectatorScreenModeControllable()
Return true if spectator screen mode control is available.
Declaration
public static bool IsSpectatorScreenModeControllable()
Returns
Type | Description |
---|---|
System.Boolean |
New(UObject, Name)
Spawn an object of this class
Declaration
public static HeadMountedDisplayFunctionLibrary New(UObject obj = null, Name name = default(Name))
Parameters
Type | Name | Description |
---|---|---|
UObject | obj | |
Name | name |
Returns
Type | Description |
---|---|
HeadMountedDisplayFunctionLibrary |
ResetOrientationAndPosition(Single, Byte)
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).
Declaration
public static void ResetOrientationAndPosition(float Yaw, byte Options)
Parameters
Type | Name | Description |
---|---|---|
System.Single | Yaw | |
System.Byte | Options |
Remarks
@param Yaw (in) the desired yaw to be set after orientation reset. @param Options (in) specifies either position, orientation or both should be reset.
SetClippingPlanes(Single, Single)
Sets near and far clipping planes (NCP and FCP) for stereo rendering.
Declaration
public static void SetClippingPlanes(float Near, float Far)
Parameters
Type | Name | Description |
---|---|---|
System.Single | Near | |
System.Single | Far |
Remarks
Similar to 'stereo ncp= fcp' console command, but NCP and FCP set by this call won't be saved in .ini file.
@param Near (in) Near clipping plane, in centimeters @param Far (in) Far clipping plane, in centimeters
SetSpectatorScreenMode(ESpectatorScreenMode)
Sets the social screen mode.
Declaration
public static void SetSpectatorScreenMode(ESpectatorScreenMode Mode)
Parameters
Type | Name | Description |
---|---|---|
ESpectatorScreenMode | Mode |
Remarks
@param Mode (in) The social screen Mode.
SetSpectatorScreenModeTexturePlusEyeLayout(Vector2D, Vector2D, Vector2D, Vector2D, Boolean, Boolean, Boolean)
Setup the layout for ESpectatorScreenMode::TexturePlusEye.
Declaration
public static void SetSpectatorScreenModeTexturePlusEyeLayout(Vector2D EyeRectMin, Vector2D EyeRectMax, Vector2D TextureRectMin, Vector2D TextureRectMax, bool bDrawEyeFirst, bool bClearBlack, bool bUseAlpha)
Parameters
Type | Name | Description |
---|---|---|
Vector2D | EyeRectMin | |
Vector2D | EyeRectMax | |
Vector2D | TextureRectMin | |
Vector2D | TextureRectMax | |
System.Boolean | bDrawEyeFirst | |
System.Boolean | bClearBlack | |
System.Boolean | bUseAlpha |
Remarks
@param EyeRectMin: min of screen rectangle the eye will be drawn in. 0-1 normalized. @param EyeRectMax: max of screen rectangle the eye will be drawn in. 0-1 normalized. @param TextureRectMin: min of screen rectangle the texture will be drawn in. 0-1 normalized. @param TextureRectMax: max of screen rectangle the texture will be drawn in. 0-1 normalized. @param bDrawEyeFirst: if true the eye is drawn before the texture, if false the reverse. @param bClearBlack: if true the render target will be drawn black before either rect is drawn.
SetSpectatorScreenTexture(Texture)
Change the texture displayed on the social screen @
Declaration
public static void SetSpectatorScreenTexture(Texture InTexture)
Parameters
Type | Name | Description |
---|---|---|
Texture | InTexture |
Remarks
param InTexture: new Texture2D
SetTrackingOrigin(Byte)
Sets current tracking origin type (eye level or floor level).
Declaration
public static void SetTrackingOrigin(byte Origin)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | Origin |
SetWorldToMetersScale(UObject, Single)
Sets the World to Meters scale, which changes the scale of the world as perceived by the player @
Declaration
public static void SetWorldToMetersScale(UObject WorldContext, float NewScale)
Parameters
Type | Name | Description |
---|---|---|
UObject | WorldContext | |
System.Single | NewScale |
Remarks
param NewScale Specifies how many Unreal units correspond to one meter in the real world
UpdateExternalTrackingHMDPosition(Transform)
Called after calibration to attempt to pull the internal tracker (e.
Declaration
public static void UpdateExternalTrackingHMDPosition(Transform ExternalTrackingTransform)
Parameters
Type | Name | Description |
---|---|---|
Transform | ExternalTrackingTransform |
Remarks
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
@param ExternalTrackingTransform The transform in world-coordinates, of the reference marker of the external tracking system
Operators
| Improve this Doc View SourceImplicit(IntPtr to HeadMountedDisplayFunctionLibrary)
Convert from IntPtr to UObject
Declaration
public static implicit operator HeadMountedDisplayFunctionLibrary(IntPtr p)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | p |
Returns
Type | Description |
---|---|
HeadMountedDisplayFunctionLibrary |