IHeadMountedDisplay

HMD device interface

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

HeadMountedDisplay

Header

/Engine/Source/Runtime/HeadMountedDisplay/Public/IHeadMountedDisplay.h

Include

#include "IHeadMountedDisplay.h"

Syntax

class IHeadMountedDisplay : public IModuleInterface

Remarks

HMD device interface

Constructors

Name Description

Public function

IHeadMountedDisplay()

Functions

Name Description

Public function Virtual Const

void

 

CreateHMDPostProcessPass_RenderThread

(
    FRDGBuilder & GraphBuilder,
    const FViewInfo& View,
    const FHMDDistortionInputs& Inputs,
    FScreenPassTexture& OutPass
)

When implemented, creates a new post process node to provide platform-specific HMD distortion.

Public function Virtual Const

bool

 

DoesAppHaveVRFocus()

Returns true, if the app has VR focus, meaning if it is rendered in the HMD.

Public function Virtual Const

bool

 

DoesAppUseVRFocus()

Returns true, if the App is using VR focus.

Public function Virtual

void

 

DrawDistortionMesh_RenderThread

(
    FRenderingCompositePassContext& Co...,
    const FIntPoint & TextureSize
)

Public function Virtual Const

void

 

DrawHiddenAreaMesh_RenderThread

(
    FRHICommandList & RHICmdList,
    EStereoscopicPass StereoPass
)

Optional method to draw a view's hidden area mesh where supported.

Public function Virtual Const

void

 

DrawVisibleAreaMesh_RenderThread

(
    FRHICommandList & RHICmdList,
    EStereoscopicPass StereoPass
)

Optional method to draw a view's visible area mesh where supported.

Public function

void

 

EnableHMD

(
    bool bEnable
)

Enables or disables switching to stereo.

Public function Virtual Const

const float ...

 

GetBlueDistortionParameters()

Public function Virtual Const

bool

 

GetChromaAbCorrectionValues

(
    FVector4 & K
)

Gets the chromatic aberration correction shader values for the device.

Public function Virtual Const

float

 

GetDistortionScalingFactor()

Gets the scaling factor, applied to the post process warping effect

Public function Virtual Const

FTexture ...

 

GetDistortionTextureLeft()

Additional optional distortion rendering parameters

Public function Virtual Const

FTexture ...

 

GetDistortionTextureRight()

Public function Virtual Const

void

 

GetDistortionWarpValues

(
    FVector4 & K
)

Gets the barrel distortion shader warp values for the device

Public function Virtual Const

void

 

GetEyeRenderParams_RenderThread

(
    const FRenderingCompositePassContex...,
    FVector2D & EyeToSrcUVScaleValue,
    FVector2D & EyeToSrcUVOffsetValue
)

Returns eye render params, used from PostProcessHMD, RenderThread.

Public function Const

void

 

GetFieldOfView

(
    float& InOutHFOVInDegrees,
    float& InOutVFOVInDegrees
)

Calculates the FOV, based on the screen dimensions of the device. Original FOV is passed as params.

Public function Virtual Const

const float ...

 

GetGreenDistortionParameters()

Public function Const

bool

 

GetHMDDistortionEnabled

(
    EShadingPath ShadingPath
)

Whether HMDDistortion post processing is enabled or not

Public function

bool

 

GetHMDMonitorInfo

(
    MonitorInfo &
)

Get the name or id of the display to output for this HMD.

Public function Virtual

EHMDWornStat ...

 

GetHMDWornState()

Returns EHMDWornState::Worn if we detect that the user is wearing the HMD, EHMDWornState::NotWorn if we detect the user is not wearing the HMD, and EHMDWornState::Unknown if we cannot detect the state.

Public function Virtual Const

FIntPoint

 

GetIdealDebugCanvasRenderTargetSize()

Gets the ideal render target size for the debug canvas on the device.

Public function Virtual Const

FIntPoint

 

GetIdealRenderTargetSize()

Gets the ideal render target size for the device. See vr.pixeldensity description.

Public function Const

float

 

GetInterpupillaryDistance()

Public function Virtual Const

float

 

GetLensCenterOffset()

Gets the offset (in clip coordinates) from the center of the screen for the lens position

Public function Virtual Const

float

 

GetPixelDenity()

Gets the current pixel density setting.

Public function Virtual Const

const float ...

 

GetRedDistortionParameters()

Public function Virtual

ISpectatorSc ...

 

GetSpectatorScreenController()

Return a pointer to the SpectatorScreenController for the HMD if supported, else null.

Public function Virtual Const

ISpectatorSc ...

 

GetSpectatorScreenController()

Public function Virtual Const

FVector2D

 

GetTextureOffsetLeft()

Public function Virtual Const

FVector2D

 

GetTextureOffsetRight()

Public function Virtual Const

FVector2D

 

GetTextureScaleLeft()

Public function Virtual Const

FVector2D

 

GetTextureScaleRight()

Public function Virtual Const

bool

 

HasHiddenAreaMesh()

Public function Virtual Const

bool

 

HasVisibleAreaMesh()

Public function Const

bool

 

IsChromaAbCorrectionEnabled()

Returns 'false' if chromatic aberration correction is off.

Public function

bool

 

IsHMDConnected()

Returns true if HMD is currently connected. It may or may not be in use.

Public function Const

bool

 

IsHMDEnabled()

Whether or not switching to stereo is enabled; if it is false, then EnableStereo(true) will do nothing.

Public function Virtual Const

bool

 

IsRenderingPaused()

If true, scene rendering should be skipped.

Public function Virtual Const

bool

 

IsSpectatorScreenActive()

Are we outputting so a Spectator Screen now.

Public function Virtual

bool

 

NeedsUpscalePostProcessPass()

Public function Virtual

void

 

RecordAnalytics()

Record analytics

Public function Virtual

void

 

SetClippingPlanes

(
    float NCP,
    float FCP
)

Sets near and far clipping planes (NCP and FCP) for the HMD.

Public function

void

 

SetInterpupillaryDistance

(
    float NewInterpupillaryDistance
)

Accessors to modify the interpupillary distance (meters)

Public function Virtual

void

 

SetPixelDensity

(
    const float NewDensity
)

Sets the pixel density. This may cause render target resizing.

Public function Virtual

void

 

UpdateScreenSettings

(
    const FViewport * InViewport
)

This method is able to change screen settings right before any drawing occurs.

Classes

Name

Description

Public struct

MonitorInfo

Deprecated Functions

Name Description

Public function Virtual

void

 

BeginRendering_GameThread()

Use IXRTrackingSystem::OnBeginRendering_GameThread instead

Public function Virtual

void

 

BeginRendering_RenderThread

(
    const FTransform & NewRelativeTrans...,
    FRHICommandListImmediate & RHICmdLi...,
    FSceneViewFamily & ViewFamily
)

Use IXRTrackingSystem::OnBeginRendering_Renderthread instead

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback