FEditorViewportClient

Viewport client for editor viewports.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

UnrealEd

Header

/Engine/Source/Editor/UnrealEd/Public/EditorViewportClient.h

Include

#include "EditorViewportClient.h"

Syntax

class FEditorViewportClient :
    public FCommonViewportClient,
    public FViewElementDrawer,
    public FGCObject

Remarks

Viewport client for editor viewports. Contains common functionality for camera movement, rendering debug information, etc.

Variables

Name Description

Public variable

float

 

AspectRatio

Protected variable

bool

 

bAllowCinematicControl

True if this window is allowed to be possessed by cinematic tools for previewing sequences in real-time

Protected variable

bool

 

bCameraLock

Camera Lock or not

Public variable

bool

 

bDisableInput

True if all input is rejected from this viewport

Protected variable

bool

 

bDraggingByHandle

True if the user is dragging by a widget handle.

Public variable

bool

 

bDrawAxes

If true, draw the axis indicators when the viewport is perspective.

Public variable

bool

 

bDrawVertices

If true, draw vertices for selected BSP brushes and static meshes if the large vertices show flag is set.

Protected variable

bool

 

bForceAudioRealtime

If true, force this viewport to use real time audio regardless of other settings

Public variable

bool

 

bForcingUnlitForNewMap

True if we've forced the SHOW_Lighting show flag off because there are no lights in the scene

Protected variable

bool

 

bHasAudioFocus

If true, this viewport gets to set audio parameters (e.g. set the listener)

Protected variable

bool

 

bHasMouseMovedSinceClick

If true, the canvas has been been moved using bMoveCanvas Mode

Protected variable

bool

 

bIsCameraMoving

Is the camera moving?

Protected variable

bool

 

bIsCameraMovingOnTick

Is the camera moving at the beginning of the tick?

Protected variable

bool

 

bIsRealtime

If the viewport is currently realtime

Protected variable

bool

 

bIsSimulateInEditorViewport

True if this level viewport can be used to view Simulate in Editor sessions

Protected variable

bool

 

bIsTracking

True when within a FMouseDeltaTracker::StartTracking/EndTracking block.

Public variable

bool

 

bLockFlightCamera

Flag to lock the viewport fly camera

Public variable

bool

 

bNeedsInvalidateHitProxy

If, following the next redraw, we should invalidate hit proxies on the viewport

Public variable

bool

 

bNeedsLinkedRedraw

Public variable

bool

 

bNeedsRedraw

The number of pending viewport redraws.

Protected variable

bool

 

bOwnsModeTools

Does this viewport client own the mode tools instance pointed at by ModeTools control the lifetime of it?

Public variable

bool

 

bSetListenerPosition

If true, the listener position will be set

Public variable

bool

 

bShouldApplyViewModifiers

Whether view modifiers should be called and applied.

Protected variable

bool

 

bShouldCheckHitProxy

True when we are in a state where we can check the hit proxy for hovering.

Protected variable

bool

 

bShowStats

True if we should draw stats over the viewport

Protected variable

bool

 

bShowWidget

Whether the widget should be drawn.

Protected variable

bool

 

bUseControllingActorViewInfo

Public variable

bool

 

bUseNumpadCameraControl

If true, numpad keys will be used to move camera in perspective viewport

Protected variable

bool

 

bUserIsControllingAtmosphericLight0

True is the use is controling the light via a shorcut

Protected variable

bool

 

bUserIsControllingAtmosphericLight1

Protected variable

bool

 

bUsesDrawHelper

True if this viewport uses a draw helper

Public variable

bool

 

bUsingOrbitCamera

True if the orbit camera is currently being used

Public variable

bool

 

bWidgetAxisControlledByDrag

True if the widget's axis is being controlled by an active mouse drag.

Protected variable

int32

 

CachedLastMouseX

Represents the last mouse position.

Protected variable

int32

 

CachedLastMouseY

Protected variable

uint32

 

CachedMouseX

Represents the last known mouse position.

Protected variable

uint32

 

CachedMouseY

Protected variable

FEditorCameraCo...

 

CameraController

Camera controller object that's used for piloting the camera around

Protected variable

float

 

CameraSpeedScalar

Camera speed scalar

Protected variable

int32

 

CameraSpeedSetting

Camera speed setting

Protected variable

FCameraControll...

 

CameraUserImpulseData

Current cached impulse state

Protected variable

TOptional< EAsp...

 

ControllingActorAspectRatioAxisConstraint

Protected variable

TArray< FPostPr...

 

ControllingActorExtraPostProcessBlends

Protected variable

TArray< float >

 

ControllingActorExtraPostProcessBlendWeights

Protected variable

FMinimalViewInf...

 

ControllingActorViewInfo

Public variable

FName

 

CurrentBufferVisualizationMode

Protected variable

FVector

 

CurrentGestureDragDelta

Cumulative camera drag and rotation deltas from trackpad gesture in current Tick

Protected variable

FRotator

 

CurrentGestureRotDelta

Protected variable

FIntPoint

 

CurrentMousePos

-1, -1 if not set

Public variable

FName

 

CurrentRayTracingDebugVisualizationMode

Protected variable

FVector

 

DefaultOrbitLocation

Protected variable

FVector

 

DefaultOrbitLookAt

Protected variable

FRotator

 

DefaultOrbitRotation

Default set up for toggling back

Protected variable

FVector

 

DefaultOrbitZoom

Protected variable

FEditorCommonDr...

 

DrawHelper

Draw helper for rendering common editor functionality like the grid

Protected variable

TWeakPtr< SEdit...

 

EditorViewportWidget

The editor viewport widget this client is attached to

Protected variable

TArray< FString...

 

EnabledStats

A list of all the stat names which are enabled for this viewport

Public variable

FEngineShowFlag...

 

EngineShowFlags

A set of flags that determines visibility for various scene elements.

Public variable

FExposureSettin...

 

ExposureSettings

Editor setting to allow designers to override the automatic expose

Protected variable

float

 

FlightCameraSpeedScale

Extra camera speed scale for flight camera

Public variable

float

 

FOVAngle

Viewport's stored horizontal field of view (saved in ini files).

Public variable

int32

 

FramesSinceLastDraw

The number of frames since this viewport was last drawn.

Protected variable

float

 

GestureMoveForwardBackwardImpulse

Public variable

FViewportStateG...

 

ImmersiveDelegate

Delegate used to get whether or not this client is in an immersive viewport

Protected variable

TMap< int32, FC...

 

JoystickStateMap

Cached state of joystick axes and buttons

Public variable

int8

 

LandscapeLODOverride

Override the LOD of landscape in this viewport.

Public variable

FEngineShowFlag...

 

LastEngineShowFlags

Previous value for engine show flags, used for toggling.

Protected variable

uint32

 

LastMouseX

Updated on each mouse drag start

Protected variable

uint32

 

LastMouseY

Protected variable

FEditorModeTool...

 

ModeTools

Editor mode tools provided to this instance.

Protected variable

FMouseDeltaTrac...

 

MouseDeltaTracker

Protected variable

FVector2D

 

MovingPreviewLightSavedScreenPos

Used for the display of the current preview light after it has been adjusted.

Protected variable

float

 

MovingPreviewLightTimer

Protected variable

TUniqueFunction...

 

OverrideShowFlagsFunc

Custom override function that will be called every ::Draw() until override is disabled

Protected variable

FPreviewScene &...

 

PreviewScene

The scene used for the viewport. Owned externally

Protected variable

TArray< TPair< ...

 

RealtimeOverrides

Temporary realtime overrides and user messages that are not saved between editor sessions.

Protected variable

uint64

 

RealTimeUntilFrameNumber

Overrides bIsRealtime until GFrameCounter is >= this number.

Protected variable

IMatineeBase &#...

 

RecordingInterpEd

InterpEd, should only be set if used for matinee recording

Protected variable

FRequiredCursor...

 

RequiredCursorVisibiltyAndAppearance

Cursor visibility and appearance information

Protected variable

FStatHitchesDat...

 

StatHitchesData

Data needed to display per-frame stat tracking when STAT HITCHES is enabled

Protected variable

FStatUnitData

 

StatUnitData

Data needed to display per-frame stat tracking when STAT UNIT is enabled

Public variable

TArray< FSceneV...

 

StereoViewStates

Viewport view state when stereo rendering is enabled

Protected variable

double

 

TimeForForceRedraw

When we have LOD locking, it's slow to force redraw of other viewports, so we delay invalidates to reduce the number of redraws

Protected variable

FTransform

 

UserControlledAtmosphericLightMatrix

Protected variable

float

 

UserIsControllingAtmosphericLightTimer

Public variable

float

 

ViewFOV

Viewport's current horizontal field of view (can be modified by locked cameras etc.)

Public variable

int32

 

ViewIndex

Index of this view in the editor's list of views

Public variable

FEditorViewport...

 

ViewModifiers

List of view modifiers to apply on view parameters.

Public variable

FViewport *

 

Viewport

Public variable

ELevelViewportT...

 

ViewportType

The viewport type.

Public variable

FSceneViewState...

 

ViewState

The viewport's scene view state.

Public variable

FViewportCamera...

 

ViewTransformOrthographic

Viewport camera transform data for orthographic viewports

Public variable

FViewportCamera...

 

ViewTransformPerspective

Viewport camera transform data for perspective viewports

Public variable

FViewportStateG...

 

VisibilityDelegate

Delegate used to get the visibility of this client from a slate viewport layout and tab configuration

Protected variable

FWidget *

 

Widget

Constructors

Name Description

Public function

FEditorViewportClient

(
    const FEditorViewportClient&
)

Non-copyable

Public function

FEditorViewportClient

(
    FEditorModeTools* InModeTools,
    FPreviewScene* InPreviewScene,
    const TWeakPtr< SEditorViewport >&...
)

Destructors

Name Description

Public function Virtual

~FEditorViewportClient()

Functions

Name Description

Protected function Virtual

void

 

AbortTracking()

Aborts mouse tracking (stop and cancel)

Public function

void

 

AddRealtimeOverride

(
    bool bShouldBeRealtime,
    FText SystemDisplayName
)

Overrides the realtime state of this viewport until RemoveViewportsRealtimeOverride is called.

Public function

void

 

AdjustTransformWidgetSize

(
    const int32 SizeDelta
)

Adjusts the current transform widget size by the provided delta value

Public function Const

bool

 

AllowsCinematicControl()

Returns true if the viewport is allowed to be possessed for previewing cinematic sequences or keyframe animations

Protected function

void

 

ApplyDeltaToRotateWidget

(
    const FRotator& InRot
)

Updates the rotate widget with the passed in delta rotation.

Protected function

void

 

ApplyRequiredCursorVisibility

(
    bool bUpdateSoftwareCursorPostion
)

Apply the required cursor visibility states from the RequiredCursorVisibiltyAndAppearance struct

Public function Virtual

FSceneView &...

 

CalcSceneView

(
    FSceneViewFamily* ViewFamily,
    const EStereoscopicPass StereoPass
)

Configures the specified FSceneView object with the view and projection matrices for this viewport.

Protected function

bool

 

CalculateEditorConstrainedViewRect

(
    FSlateRect& OutSafeFrameRect,
    FViewport* InViewport,
    const float DPIScale
)

Helper function to calculate the safe frame rectangle on the current viewport

Public function Virtual Const

FMatrix

 

CalcViewRotationMatrix

(
    const FRotator& InViewRotation
)

Computes a matrix to use for viewport location and rotation

Public function Virtual Const

bool

 

CanCycleWidgetMode()

Whether or not the widget mode can be cycled

Public function Virtual

FDropQuery

 

CanDropObjectsAtCoordinates

(
    int32 MouseX,
    int32 MouseY,
    const FAssetData& AssetInfo
)

Checks the viewport to see if the given object can be dropped using the given mouse coordinates local to this viewport

Public function Virtual Const

bool

 

CanSetWidgetMode

(
    FWidget::EWidgetMode NewMode
)

Whether or not the new widget mode can be set in this viewport

Public function Virtual Const

bool

 

CanUseDragTool()

Public function

void

 

CenterViewportAtPoint

(
    const FVector& NewLookAt,
    bool bInstant
)

Translates the viewport so that the given LookAt point is at the center of viewport, while maintaining current Location/LookAt distance

Public function

void

 

ChangeBufferVisualizationMode

(
    FName InName
)

Changes the buffer visualization mode for this viewport

Public function

void

 

ChangeRayTracingDebugVisualizationMode

(
    FName InName
)

Changes the ray tracing debug visualization mode for this viewport

Public function Virtual

void

 

CheckHoveredHitProxy

(
    HHitProxy* HoveredHitProxy
)

Called when the mouse cursor is hovered over a hit proxy

Public function

void

 

ClearAudioFocus()

Public function Const

void

 

ConvertMovementToDragRot

(
    const FVector& InDelta,
    FVector& InDragDelta,
    FRotator& InRotDelta
)

Converts a generic movement delta into drag/rotation deltas based on the viewport and keys held down.

Public function Const

void

 

ConvertMovementToOrbitDragRot

(
    const FVector& InDelta,
    FVector& InDragDelta,
    FRotator& InRotDelta
)

Public function Virtual

void

 

DestroyDropPreviewActors()

If dragging an actor for placement, this function destroys the actor.

Public function

void

 

DisableOverrideEngineShowFlags()

Disable EngineShowFlags override if enabled

Public function

void

 

DrawActorScreenSpaceBoundingBox

(
    FCanvas* InCanvas,
    const FSceneView* InView,
    FViewport* InViewport,
    AActor* InActor,
    const FLinearColor& InColor,
    const bool bInDrawBracket,
    const FString& InLabelText
)

Draws a screen space bounding box around the specified actor

Protected function

void

 

DrawAxes

(
    FViewport* Viewport,
    FCanvas* Canvas,
    const FRotator* InRotation,
    EAxisList::Type InAxis
)

Draws viewport axes

Public function

void

 

DrawBoundingBox

(
    FBox& Box,
    FCanvas* InCanvas,
    const FSceneView* InView,
    const FViewport* InViewport,
    const FLinearColor& InColor,
    const bool bInDrawBracket,
    const FString& InLabelText
)

Public function Virtual

void

 

DrawCanvas

(
    FViewport& InViewport,
    FSceneView& View,
    FCanvas& Canvas
)

Called to draw onto the viewports 2D canvas

Public function Virtual

void

 

DrawPreviewLightVisualization

(
    const FSceneView* View,
    FPrimitiveDrawInterface* PDI
)

Draws a visualization of the preview light if it was recently moved.

Protected function

void

 

DrawScaleUnits

(
    FViewport* Viewport,
    FCanvas* Canvas,
    const FSceneView& InView
)

Draws viewport scale units

Public function Virtual

bool

 

DropObjectsAtCoordinates

(
    int32 MouseX,
    int32 MouseY,
    const TArray< UObject* >& Dro...,
    TArray< AActor* >& OutNewActo...,
    bool bOnlyDropOnTarget,
    bool bCreateDropPreview,
    bool bSelectActors,
    UActorFactory* FactoryToUse
)

Attempts to intelligently drop the given objects in the viewport, using the given mouse coordinates local to this viewport

Protected function

void

 

EnableCameraLock

(
    bool bEnable
)

Enables or disables camera lock

Public function

void

 

EnableOverrideEngineShowFlags

(
    TUniqueFunction< void...
)

Enable customization of the EngineShowFlags for rendering.

Public function

void

 

FocusViewportOnBox

(
    const FBox& BoundingBox,
    bool bInstant
)

Focuses the viewport to the center of the bounding box ensuring that the entire box is in view

Protected function Virtual Const

bool

 

GetActiveSafeFrame

(
    float& OutAspectRatio
)

Helper used by DrawSafeFrames to get the current safe frame aspect ratio.

Public function Virtual Const

FLinearColor

 

GetBackgroundColor()

Public function Virtual Const

uint32

 

GetCachedMouseX()

Public function Virtual Const

uint32

 

GetCachedMouseY()

Public function

FEditorCamer...

 

GetCameraController()

Public function Const

float

 

GetCameraSpeed()

Get the camera speed for this viewport

Public function Const

float

 

GetCameraSpeed

(
    int32 SpeedSetting
)

Get the camera speed for this viewport based on the specified speed setting

Public function Virtual Const

float

 

GetCameraSpeedScalar()

Get the camera speed scalar for this viewport

Public function Virtual Const

int32

 

GetCameraSpeedSetting()

Get the camera speed setting for this viewport

Public function Const

FText

 

GetCurrentBufferVisualizationModeDisplayName()

It returns the FText display name associate with CurrentBufferVisualizationMode

Public function Const

EAxisList::T...

 

GetCurrentWidgetAxis()

Public function

FViewportCur...

 

GetCursorWorldLocationFromMousePos()

Gets the world space cursor info from the current mouse position

Public function Const

TSharedPtr< ...

 

GetCustomTemporalUpscalerData()

Public function Const

TSharedPtr< ...

 

GetEditorViewportWidget()

Get the editor viewport widget

Public function Const

float

 

GetFarClipPlaneOverride()

Get the far clipping plane override for this viewport.

Public function

FVector

 

GetHitProxyObjectLocation

(
    int32 X,
    int32 Y
)

Returns the location of the object at the given viewport X,Y

Protected function

FCachedJoyst...

 

GetJoystickState

(
    const uint32 InControllerID
)

Gets a joystick state cache for the specified controller ID

Public function Virtual Const

FMatrix

 

GetLocalCoordinateSystem()

Public function Const

const FVecto...

 

GetLookAtLocation()

Public function Const

FEditorModeT...

 

GetModeTools()

Editor mode tool manager being used for this viewport client

Public function Const

FMouseDeltaT...

 

GetMouseDeltaTracker()

Mouse info is usually transformed to gizmo space before FEdMode handles it, this allows raw delta X and Y access

Public function Const

float

 

GetNearClipPlane()

Get the near clipping plane for this viewport.

Public function Const

float

 

GetOrthoUnitsPerPixel

(
    const FViewport* Viewport
)

Public function Const

EViewModeInd...

 

GetOrthoViewMode()

Public function Const

float

 

GetOrthoZoom()

Public function Const

EViewModeInd...

 

GetPerspViewMode()

Public function Virtual Const

bool

 

GetPivotForOrbit

(
    FVector& OutPivot
)

Get the custom pivot point around which the camera should orbit for this viewport

Public function

FPreviewScen...

 

GetPreviewScene()

Retrieves the FPreviewScene used by this instance of FEditorViewportClient.

Public function Const

int32

 

GetPreviewScreenPercentage()

Public function Const

FText

 

GetRealtimeOverrideMessage()

Public function Virtual Const

FSceneInterf...

 

GetScene()

Public function

float

 

GetSceneDepthAtLocation

(
    int32 X,
    int32 Y
)

Returns the scene depth at the given viewport X,Y

Public function Const

const FVecto...

 

GetViewLocation()

Public function Const

EViewModeInd...

 

GetViewMode()

Public function

TMap< int32,...

 

GetViewModeParamNameMap()

Returns the map allowing to convert from the viewmode param to a name.

Public function

void

 

GetViewportDimensions

(
    FIntPoint& OutOrigin,
    FIntPoint& OutSize
)

Gets the dimensions of the viewport

Public function Virtual Const

ELevelViewpo...

 

GetViewportType()

Returns the effective viewport type (taking into account any actor locking or camera possession)

Public function Const

const FRotat...

 

GetViewRotation()

Public function

FViewportCam...

 

GetViewTransform()

Gets ViewportCameraTransform object for the current viewport type

Public function Const

const FViewp...

 

GetViewTransform()

Public function Virtual Const

FMatrix

 

GetWidgetCoordSystem()

Public function Virtual Const

ECoordSystem

 

GetWidgetCoordSystemSpace()

Public function Virtual Const

FVector

 

GetWidgetLocation()

Public function Virtual Const

FWidget::EWi...

 

GetWidgetMode()

Public function Virtual Const

bool

 

HandleIsShowFlagEnabled

(
    FEngineShowFlags::EShowFlag EngineS...
)

Delegate handler fired to determine the state of a show flag

Public function Virtual

void

 

HandleToggleShowFlag

(
    FEngineShowFlags::EShowFlag EngineS...
)

Delegate handler fired when a show flag is toggled

Public function Virtual Const

bool

 

HasDropPreviewActors()

Returns true if a placement dragging actor exists

Public function Const

bool

 

HasRealtimeOverride

(
    FText SystemDisplayName
)

Returns whether there's a realtime override registered with the given system name.

Public function

void

 

InputAxisForOrbit

(
    FViewport* Viewport,
    const FVector& DragDelta,
    FVector& Drag,
    FRotator& Rot
)

Public function

bool

 

InputTakeScreenshot

(
    FViewport* Viewport,
    FKey Key,
    EInputEvent Event
)

Implements screenshot capture for editor viewports.

Public function Virtual

bool

 

InputWidgetDelta

(
    FViewport* InViewport,
    EAxisList::Type CurrentAxis,
    FVector& Drag,
    FRotator& Rot,
    FVector& Scale
)

Called to give the viewport client a chance to handle widgets being moved

Public function

void

 

Invalidate

(
    bool bInvalidateChildViews,
    bool bInvalidateHitProxies
)

Invalidates this viewport and optionally child views.

Protected function

void

 

InvalidateViewportWidget()

Invalidates the viewport widget (if valid) to register its active timer

Public function Const

bool

 

IsActiveViewportType

(
    ELevelViewportType InViewportType
)

Public function Const

bool

 

IsActiveViewportTypeInRotation()

Public function Const

bool

 

IsAltPressed()

Utility functions to return the modifier key states.

Public function Virtual Const

bool

 

IsAspectRatioConstrained()

Is the aspect ratio currently constrained?

Public function Const

bool

 

IsBufferVisualizationModeSelected

(
    FName InName
)

Checks if a buffer visualization mode is selected

Public function Const

bool

 

IsCameraLocked()

Callback for checking the camera lock flag.

Public function Const

bool

 

IsCmdPressed()

Public function Const

bool

 

IsCtrlPressed()

Public function Const

bool

 

IsEngineShowFlagsOverrideEnabled()

Public function Const

bool

 

IsFlightCameraActive()

Returns whether or not the flight camera is active

Public function Const

bool

 

IsForcedRealtimeAudio()

Public function Const

bool

 

IsInImmersiveViewport()

Public function Virtual Const

bool

 

IsLevelEditorClient()

If true, this is a level editor viewport

Public function

bool

 

IsLowDPIPreview()

Public function Const

bool

 

IsMatineeRecordingWindow()

Returns true if camera recoil is currently allowed

Public function Const

bool

 

IsMovingCamera()

Public function Const

bool

 

IsPerspective()

Returns true if this viewport is perspective.

Public function Const

bool

 

IsRayTracingDebugVisualizationModeSelected

(
    FName InName
)

Checks if a ray tracing debug visualization mode is selected

Public function Const

bool

 

IsRealtime()

Public function Const

bool

 

IsRealtimeOverrideSet()

Public function Const

bool

 

IsSetShowBoundsChecked()

Callback for checking the bounds show flag.

Public function Const

bool

 

IsSetShowCollisionChecked()

Callback for checking the collision geometry show flag.

Public function Const

bool

 

IsSetShowGridChecked()

Callback for checking the grid show flag.

Public function Const

bool

 

IsShiftPressed()

Public function Const

bool

 

IsShowingAspectRatioBarDisplay()

Public function Const

bool

 

IsShowingSafeFrameBoxDisplay()

Public function Const

bool

 

IsSimulateInEditorViewport()

Public function Const

bool

 

IsTracking()

Public function Const

bool

 

IsUsingAbsoluteTranslation

(
    bool bAlsoCheckAbsoluteRotation
)

Determines whether this viewport is currently allowed to use Absolute Movement

Public function Const

bool

 

IsViewModeEnabled

(
    EViewModeIndex InViewModeIndex
)

Public function Const

bool

 

IsViewModeParam

(
    int32 InViewModeParam
)

Public function Const

bool

 

IsVisible()

True if the window is maximized or floating

Public function Const

bool

 

IsVisualizeCalibrationMaterialEnabled()

Returns whether visualize debug material is enabled.

Public function Virtual

TSharedPtr< ...

 

MakeDragTool

(
    EDragTool::Type DragToolType
)

Called to make a drag tool when the user starts dragging in the viewport

Public function

void

 

MarkMouseMovedSinceClick()

Forces a cursor update and marks the window as a move has occurred

Public function

void

 

MoveViewportCamera

(
    const FVector& InDrag,
    const FRotator& InRot,
    bool bDollyCamera
)

Moves the viewport Scamera according to the specified drag and rotation.

Protected function Virtual

void

 

NudgeSelectedObjects

(
    const FInputEventState& InputState
)

Protected function

void

 

OnChangeCameraSpeed

(
    const FInputEventState& InputState
)

Called when a user changes the camera speed

Protected function

void

 

OnDollyPerspectiveCamera

(
    const FInputEventState& InputState
)

Called when a user dollys the perspective camera

Public function

void

 

OnEditorModeIDChanged

(
    const FEditorModeID& EditorModeID,
    bool bIsEntering
)

Protected function

void

 

OnOrthoZoom

(
    const FInputEventState& InputState,
    float Scale
)

Called when a user zooms the ortho viewport

Public function

void

 

OpenScreenshot

(
    FString SourceFilePath
)

Opens the screenshot in the uses default bitmap viewer (determined by OS)

Public function

void

 

OverrideFarClipPlane

(
    const float InFarPlane
)

Override the far clipping plane. Set to a negative value to disable the override.

Protected function

void

 

OverrideNearClipPlane

(
    float InNearPlane
)

Subclasses may override the near clipping plane. Set to a negative value to disable the override.

Public function Virtual

void

 

OverridePostProcessSettings

(
    FSceneView& View
)

Called to override any post process settings for the view

Protected function Virtual

void

 

PerspectiveCameraMoved()

Called when the perspective viewport camera moves

Public function

bool

 

PopRealtimeOverride()

Removes the last added realtime override.

Public function Virtual

void

 

ProcessClick

(
    FSceneView& View,
    HHitProxy* HitProxy,
    FKey Key,
    EInputEvent Event,
    uint32 HitX,
    uint32 HitY
)

Called when the user clicks in the viewport

Protected function

void

 

ProcessClickInViewport

(
    const FInputEventState& InputState,
    FSceneView& View
)

Handles clicking in the viewport

Protected function

void

 

ProcessDoubleClickInViewport

(
    const FInputEventState& InputState,
    FSceneView& View
)

Handles double clicking in the viewport

Protected function Virtual

void

 

RedrawAllViewportsIntoThisScene()

Invalidates this and other linked viewports (anything viewing the same scene)

Public function

void

 

RemoveCameraRoll()

Public function

bool

 

RemoveRealtimeOverride

(
    FText SystemDisplayName,
    bool bCheckMissingOverride
)

Removes the most recent realtime override registered with the given system name.

Public function

void

 

RenderDragTool

(
    const FSceneView* View,
    FCanvas* Canvas
)

Render the drag tool in the viewport

Public function Virtual

void

 

RequestRealTimeFrames

(
    uint64 NumRealTimeFrames
)

Get the number of real-time frames to draw (overrides bRealtime) @note When non-zero, the viewport will render RealTimeFrameCount frames in real-time mode, then revert back to bIsRealtime this can be used to ensure that not only the viewport renders a frame, but also that the world ticks

Public function Virtual

void

 

RotateViewportType()

Rotate through viewport view options

Public function Const

void

 

SaveRealtimeStateToConfig

(
    bool& ConfigVar
)

Saves the realtime state to a config location. Does not save any temp overrides

Public function

void

 

SetAllowCinematicControl

(
    bool bInAllowCinematicControl
)

Sets whether or not this viewport is allowed to be possessed by cinematic/scrubbing tools

Public function

void

 

SetAudioFocus()

Public function Virtual

void

 

SetCameraLock()

Callback for toggling the camera lock flag.

Public function

void

 

SetCameraSetup

(
    const FVector& LocationForOrbiting,
    const FRotator& InOrbitRotation,
    const FVector& InOrbitZoom,
    const FVector& InOrbitLookAt,
    const FVector& InViewLocation,
    const FRotator& InViewRotation
)

This set ups camera for both orbit and non orbit control

Public function Virtual

void

 

SetCameraSpeedScalar

(
    float SpeedScalar
)

Set the camera speed scalar for this viewport

Public function Virtual

void

 

SetCameraSpeedSetting

(
    int32 SpeedSetting
)

Set the speed setting for the camera in this viewport

Public function Virtual

void

 

SetCurrentWidgetAxis

(
    EAxisList::Type InAxis
)

Sets the current axis being manipulated by the transform widget

Public function

void

 

SetCustomTemporalUpscalerData

Public function

void

 

SetForcedAudioRealtime

(
    bool bShouldForceAudioRealtime
)

True to force realtime audio to be true, false to stop forcing it

Public function

void

 

SetGameView

(
    bool bGameViewEnable
)

Public function

void

 

SetInitialViewTransform

(
    ELevelViewportType ViewportType,
    const FVector& ViewLocation,
    const FRotator& ViewRotation,
    float InOrthoZoom
)

Public function

void

 

SetLookAtLocation

(
    const FVector& LookAt,
    bool bRecalculateView
)

Sets the look at location of the viewports camera for orbit *

Public function

void

 

SetLowDPIPreview

(
    bool LowDPIPreview
)

Set whether previewing for low DPI.

Public function

void

 

SetMatineeRecordingWindow

(
    IMatineeBase* InInterpEd
)

Allows custom disabling of camera recoil

Public function

void

 

SetOrthoZoom

(
    float InOrthoZoom
)

Sets ortho zoom amount

Public function

void

 

SetPreviewScreenPercentage

(
    int32 PreviewScreenPercentage
)

Set preview screen percentage on UI behalf.

Public function

void

 

SetRealtime

(
    bool bInRealtime
)

Sets whether or not the viewport updates in realtime.

Protected function

void

 

SetRequiredCursor

(
    const bool bHardwareCursorVisible,
    const bool bSoftwareCursorVisible
)

Sets the required hardware and software cursor.

Public function

void

 

SetRequiredCursorOverride

(
    bool WantOverride,
    EMouseCursor::Type RequiredCursor
)

Overrides current cursor.

Public function

void

 

SetShowAspectRatioBarDisplay

(
    bool bEnable
)

Aspect ratio bar display settings

Public function

void

 

SetShowBounds

(
    bool bShow
)

Sets the show bounds flag

Public function

void

 

SetShowCollision()

Callback for toggling the collision geometry show flag.

Public function

void

 

SetShowGrid()

Callback for toggling the grid show flag.

Public function

void

 

SetShowSafeFrameBoxDisplay

(
    bool bEnable
)

Public function Virtual

void

 

SetupViewForRendering

(
    FSceneViewFamily& ViewFamily,
    FSceneView& View
)

Called to do any additional set up of the view for rendering

Public function

void

 

SetViewLocation

(
    const FVector& NewLocation
)

Sets the location of the viewport's camera

Public function

void

 

SetViewLocationForOrbiting

(
    const FVector& LookAtPoint,
    float DistanceToCamera
)

Sets the camera view location such that the LookAtPoint point is at the specified location.

Public function Virtual

void

 

SetViewMode

(
    EViewModeIndex InViewModeIndex
)

Sets how the viewport is displayed (lit, wireframe, etc) for the current viewport type

Public function

void

 

SetViewModeParam

(
    int32 InViewModeParam
)

Set the viewmode param.

Public function

void

 

SetViewModes

(
    const EViewModeIndex InPerspViewMod...,
    const EViewModeIndex InOrthoViewMod...
)

Sets how the viewport is displayed (lit, wireframe, etc)

Public function Virtual

void

 

SetViewportType

(
    ELevelViewportType InViewportType
)

Set the viewport type of the client

Public function

void

 

SetViewRotation

(
    const FRotator& NewRotation
)

Sets the location of the viewport's camera

Public function Virtual

void

 

SetVREditView

(
    bool bGameViewEnable
)

Public function Virtual

void

 

SetWidgetCoordSystemSpace

(
    ECoordSystem NewCoordSystem
)

Sets the coordinate system space to use

Public function Virtual

void

 

SetWidgetMode

(
    FWidget::EWidgetMode NewMode
)

Sets the current widget mode

Public function

void

 

SetWidgetModeOverride

(
    FWidget::EWidgetMode InWidgetMode
)

Overrides current widget mode

Public function Virtual Const

bool

 

ShouldLockPitch()

Public function Virtual Const

bool

 

ShouldOrbitCamera()

Public function Virtual Const

bool

 

ShouldScaleCameraSpeedByDistance()

Public function Const

bool

 

ShouldShowStats()

Returns true if status information should be displayed over the viewport

Protected function Const

bool

 

ShouldUseMoveCanvasMovement()

Determines if the new MoveCanvas movement should be used

Public function

void

 

ShowWidget

(
    const bool bShow
)

Show or hide the widget.

Protected function

void

 

StartTrackingDueToInput

(
    const FInputEventState& InputState,
    FSceneView& View
)

Starts tracking the mouse due to mouse input

Protected function

void

 

StopTracking()

Stops any mouse tracking

Public function Const

bool

 

SupportsLowDPIPreview()

Public function Const

bool

 

SupportsPreviewResolutionFraction()

Public function

void

 

TakeHighResScreenShot()

Public function

void

 

TakeScreenshot

(
    FViewport* Viewport,
    bool bInvalidateViewport
)

Takes the screenshot capture, this is called by keybinded events as well InputTakeScreenshot

Public function Virtual

void

 

Tick

(
    float DeltaSeconds
)

Ticks this viewport client

Public function

void

 

ToggleOrbitCamera

(
    bool bEnableOrbitCamera
)

Toggle between orbit camera and fly camera

Public function

bool

 

ToggleRealtime()

Toggles whether or not the viewport updates in realtime and returns the updated state.

Public function

void

 

ToggleShowBounds()

Callback for toggling the bounds show flag.

Public function Virtual

void

 

TrackingStarted

(
    const FInputEventState& InInputSta...,
    bool bIsDraggingWidget,
    bool bNudge
)

Called when mouse movement tracking begins

Public function Virtual

void

 

TrackingStopped()

Called when mouse movement tracking stops

Public function

FVector

 

TranslateDelta

(
    FKey InKey,
    float InDelta,
    bool InNudge
)

Determines which axis InKey and InDelta most refer to and returns a corresponding FVector.

Public function Static

FString

 

UnrealUnitsToSiUnits

(
    float UnrealUnits
)

Get a prettified string representation of the specified unreal units

Protected function

void

 

UpdateAndApplyCursorVisibility()

Updates the visibility of the hardware and software cursors according to the viewport's state.

Public function Virtual

bool

 

UpdateDropPreviewActors

(
    int32 MouseX,
    int32 MouseY,
    const TArray< UObject* >& Dro...,
    bool& out_bDroppedObjectsVisible,
    UActorFactory* FactoryToUse
)

If dragging an actor for placement, this function updates its position.

Public function Virtual

void

 

UpdateGestureDelta()

Called each frame to update the viewport based on delta trackpad gestures

Public function

void

 

UpdateHiddenCollisionDrawing()

When collision draw mode changes, this function allows hidden objects to be drawn, so hidden colliding objects can be seen

Public function Virtual

void

 

UpdateLinkedOrthoViewports

(
    bool bInvalidate
)

Public function Virtual

void

 

UpdateMouseDelta()

Called each frame to update the viewport based on delta mouse movements

Protected function

void

 

UpdateRequiredCursorVisibility()

Setup the cursor visibility state we require and store in RequiredCursorVisibiltyAndAppearance struct

Public function Virtual Const

bool

 

UseAppTime()

Should this viewport use app time instead of world time.

Public function Virtual Const

bool

 

WantsDrawWhenAppIsHidden()

Normally we disable all viewport rendering when the editor is minimized, but the render commands may need to be processed regardless (like if we were outputting to a monitor via capture card).

Overridden from FCommonViewportClient

Name Description

Protected function Virtual Const

float

 

UpdateViewportClientWindowDPIScale()

FCommonViewportClient interface

Overridden from FViewportClient

Name Description

Public function Virtual

void

 

CapturedMouseMove

(
    FViewport* InViewport,
    int32 InMouseX,
    int32 InMouseY
)

Called when the mouse is moved while a window input capture is in effect

Public function Virtual

void

 

Draw

(
    FViewport* Viewport,
    FCanvas* Canvas
)

Public function Virtual

EMouseCursor...

 

GetCursor

(
    FViewport* Viewport,
    int32 X,
    int32 Y
)

Retrieves the cursor that should be displayed by the OS

Public function Virtual Const

const TArray...

 

GetEnabledStats()

Get a ptr to the enabled stats list

Public function Virtual Const

FStatHitches...

 

GetStatHitchesData()

Get a ptr to the stat unit data for this viewport

Public function Virtual Const

FStatUnitDat...

 

GetStatUnitData()

Get a ptr to the stat unit data for this viewport

Public function Virtual Const

UWorld *

 

GetWorld()

Use the viewports Scene to get a world.

Public function Virtual

bool

 

InputAxis

(
    FViewport* Viewport,
    int32 ControllerId,
    FKey Key,
    float Delta,
    float DeltaTime,
    int32 NumSamples,
    bool bGamepad
)

Check an axis movement received by the viewport.

Public function Virtual

bool

 

InputGesture

(
    FViewport* Viewport,
    EGestureEvent GestureType,
    const FVector2D& GestureDelta,
    bool bIsDirectionInvertedFromDevice
)

Check a gesture event received by the viewport.

Public function Virtual Const

bool

 

IsInGameView()

Returns true if this viewport is excluding non-game elements from its display

Public function Virtual Const

bool

 

IsOrtho()

Returns true if this viewport is orthogonal.

Public function Virtual Const

bool

 

IsStatEnabled

(
    const FString& InName
)

Check whether a specific stat is enabled for this viewport

Public function Virtual

void

 

LostFocus

(
    FViewport* Viewport
)

Public function Virtual

void

 

MouseEnter

(
    FViewport* Viewport,
    int32 x,
    int32 y
)

Public function Virtual

void

 

MouseLeave

(
    FViewport* Viewport
)

Public function Virtual

void

 

MouseMove

(
    FViewport* Viewport,
    int32 x,
    int32 y
)

Public function Virtual

void

 

ProcessAccumulatedPointerInput

(
    FViewport* InViewport
)

Called from slate when input is finished for this frame, and we should process any queued mouse moves.

Public function Virtual

bool

 

ProcessScreenShots

(
    FViewport* Viewport
)

FViewportClient interface

Public function Virtual

void

 

ReceivedFocus

(
    FViewport* Viewport
)

Public function Virtual

void

 

RedrawRequested

(
    FViewport* Viewport
)

Public function Virtual

void

 

RequestInvalidateHitProxy

(
    FViewport* Viewport
)

Public function Virtual

void

 

SetEnabledStats

(
    const TArray< FString >& InEnabled...
)

Sets all the stats that should be enabled for the viewport

Public function Virtual

void

 

SetShowStats

(
    bool bWantStats
)

Sets whether or not stats info is displayed over the viewport

Overridden from FViewElementDrawer

Name Description

Public function Virtual

void

 

Draw

(
    const FSceneView* View,
    FPrimitiveDrawInterface* PDI
)

FViewElementDrawer interface

Overridden from FGCObject

Name Description

Public function Virtual

void

 

AddReferencedObjects

(
    FReferenceCollector& Collector
)

FGCObject interface

Public function Virtual Const

FString

 

GetReferencerName()

Use this method to report a name for your referencer.

Operators

Name Description

Public function

FEditorViewp...

 

operator=

(
    const FEditorViewportClient&
)

Classes

Name

Description

Protected struct

FRequiredCursorState

Used to store the required cursor visibility states and override cursor appearance

Public class

ICustomTemporalUpscalerData

Used by the custom temporal upscaler plugin.

Enums

Name

Description

Private enum

ESceneDPIMode

DPI mode for scene rendering.

Constants

Name

Description

DefaultOrthoViewMode

Default view mode for orthographic viewports

DefaultPerspectiveViewMode

Default view mode for perspective viewports

MaxCameraSpeeds

The Maximum Mouse/Camera Speeds Setting supported

SafePadding

Constant for how much the camera safe zone rectangle is inset when being displayed in the editor

Deprecated Functions

Name Description

Public function Virtual

bool

 

InputKey

(
    FViewport* Viewport,
    int32 ControllerId,
    FKey Key,
    EInputEvent Event,
    float AmountDepressed,
    bool bGamepad
)

Use the new InputKey(const FInputKeyEventArgs& EventArgs) function.

Public function

void

 

OnEditorModeChanged

(
    FEdMode* EditorMode,
    bool bIsEntering
)

Use OnEditorModeIDChanged() instead.

Public function

void

 

RemoveRealtimeOverride()

RemoveRealtimeOverride now takes a system display name to help remove the correct override.

Public function

void

 

RestoreRealtime

(
    const bool bAllowDisable
)

To save and restore realtime state non-permanently use AddRealtimeOverride and RemoveRealtimeOverride

Public function

void

 

SetRealtime

(
    bool bInRealtime,
    bool bStoreCurrentValue
)

SetRealtime no longer takes in bStoreCurrentValue parameter. For temporary overrides use AddRealtimeOverride

Public function

void

 

SetRealtimeOverride

(
    bool bShouldBeRealtime,
    FText SystemDisplayName
)

SetRealtimeOverride is replaced with AddRealtimeOverride, as multiple overrides can now be added.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss