FHeadMountedDisplayBase

Default implementation for various [IHeadMountedDisplay](API\Runtime\HeadMountedDisplay\IHeadMountedDisplay) methods.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

HeadMountedDisplay

Header

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

Include

#include "HeadMountedDisplayBase.h"

Syntax

class FHeadMountedDisplayBase :
    public FXRTrackingSystemBase,
    public IHeadMountedDisplay,
    public IStereoRendering

Remarks

Default implementation for various IHeadMountedDisplay methods. You can extend this class instead of IHeadMountedDisplay directly when implementing support for new HMD devices.

Variables

Constructors

Name Description

Public function

FHeadMountedDisplayBase

(
    IARSystemSupport* InARImplemen...
)

Destructors

Name Description

Public function Virtual

~FHeadMountedDisplayBase()

Functions

Name Description

Public function Virtual Const

void

 

CopyTexture_RenderThread

(
    FRHICommandListImmediate& RHICmdLi...,
    FRHITexture2D* SrcTexture,
    FIntRect SrcRect,
    FRHITexture2D* DstTexture,
    FIntRect DstRect,
    bool bClearBlack,
    bool bNoAlpha
)

Helper to copy one render target into another for spectator screen display.

Protected function Static

void

 

CVarSinkHandler()

CVar sink for pixel density

Public function Virtual Const

FVector2D

 

GetEyeCenterPoint_RenderThread

(
    EStereoscopicPass Eye
)

Spectator Screen Hooks into specific implementations Get the point on the left eye render target which the viewers eye is aimed directly at when looking straight forward.

Public function Virtual Const

FIntRect

 

GetFullFlatEyeRect_RenderThread

(
    FTexture2DRHIRef EyeTexture
)

Get the rectangle of the HMD rendertarget for the left eye which seems undistorted enough to be cropped and displayed on the spectator screen.

Protected function Virtual

FTexture2DRH...

 

GetOverlayLayerTarget_RenderThread

(
    EStereoscopicPass StereoPass,
    FIntRect& InOutViewport
)

Implement this method to provide an alternate render target for head locked stereo layer rendering, when using the default Stereo Layers implementation.

Protected function Virtual

FTexture2DRH...

 

GetSceneLayerTarget_RenderThread

(
    EStereoscopicPass StereoPass,
    FIntRect& InOutViewport
)

Implement this method to override the render target for scene based stereo layers.

Protected function Virtual

bool

 

PopulateAnalyticsAttributes

(
    TArray< struct FAnalyticsEventAttri...
)

Called by RecordAnalytics when creating the analytics event sent during HMD initialization.

Overridden from IXRTrackingSystem

Name Description

Public function Virtual Const

bool

 

IsHeadTrackingAllowed()

Default IXRTrackingSystem implementation

Public function Virtual Const

bool

 

IsHeadTrackingEnforced()

Optional IXRTrackingSystem methods.

Public function Virtual

void

 

OnLateUpdateApplied_RenderThread

(
    const FTransform& NewRelativeTrans...
)

Called just after the late update on the render thread passing back the current relative transform.

Public function Virtual

void

 

SetHeadTrackingEnforced

(
    bool bEnabled
)

Can be used to enforce tracking even when stereo rendering is disabled.

Overridden from IHeadMountedDisplay

Name Description

Public function Virtual Const

bool

 

GetHMDDistortionEnabled

(
    EShadingPath ShadingPath
)

Whether HMDDistortion post processing is enabled or not

Public function Virtual Const

ISpectatorSc...

 

GetSpectatorScreenController()

Public function Virtual

ISpectatorSc...

 

GetSpectatorScreenController()

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

Public function Virtual Const

bool

 

IsSpectatorScreenActive()

Are we outputting so a Spectator Screen now.

Public function Virtual

void

 

RecordAnalytics()

Record analytics - To add custom information logged with the analytics, override PopulateAnalyticsAttributes

Overridden from IStereoRendering

Name Description

Public function Virtual

void

 

CalculateStereoViewOffset

(
    const enum EStereoscopicPass Stereo...,
    FRotator& ViewRotation,
    const float WorldToMeters,
    FVector& ViewLocation
)

Calculates the offset for the camera position, given the specified position, rotation, and world scale

Public function Virtual

IStereoLayer...

 

GetStereoLayers()

Default stereo layer implementation

Public function Virtual

void

 

InitCanvasFromView

(
    FSceneView* InView,
    UCanvas* Canvas
)

Sets view-specific params (such as view projection matrix) for the canvas.

Constants

Name

Description

CVarSink

PixelDensityMax

PixelDensityMin

Sane pixel density values.

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