UVREditorInteractor

VREditor default interactor

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

VREditor

Header

/Engine/Source/Editor/VREditor/Public/VREditorInteractor.h

Include

#include "VREditorInteractor.h"

Syntax

class UVREditorInteractor : public UViewportInteractor

Remarks

VREditor default interactor

Variables

Name Description

Protected variable

bool

 

bFlickActionExecuted

Whether a flick action was executed

Protected variable

bool

 

bForceShowLaser

Forcing to show laser

Protected variable

bool

 

bHasTriggerBeenReleasedSinceLastPress

True if trigger has been fully released since the last press

Protected variable

bool

 

bIsPressingTrackpad

True if pressing trackpad button (or analog stick button is down)

Protected variable

bool

 

bIsScrubbingSequence

Whether or not this controller is being used to scrub sequencer

Protected variable

bool

 

bIsTouchingTrackpad

Trackpad supportTrue if the trackpad is actively being touched

Protected variable

bool[2]

 

bIsTrackpadPositionValid

True if we have a valid trackpad position (for each axis)

Protected variable

bool

 

bIsTriggerFullyPressed

Trigger axis stateTrue if trigger is fully pressed right now (or within some small threshold)

Protected variable

bool

 

bIsTriggerPressed

True if the trigger is currently pulled far enough that we consider it in a "half pressed" state

Protected variable

bool

 

bIsUndoRedoSwipeEnabled

Whether swiping left/right on touchpad/joystick triggers undo/redo

Protected variable

bool

 

bWantHelpLabels

True if we want help labels to be visible right now, otherwise false

Protected variable

FName

 

ControllerMotionSource

HelpRight or left hand

Protected variable

TOptional< FLin...

 

ForceLaserColor

The color that will be used for one frame

Protected variable

TObjectPtr< cla...

 

HandMeshComponent

GraphicsAccess to the current handmesh.

Protected variable

TMap< FKey, cla...

 

HelpLabels

Help labels for buttons on the motion controllers

Protected variable

FTimespan

 

HelpLabelShowOrHideStartTime

Time that we either started showing or hiding help labels (for fade transitions)

Protected variable

FVector2D

 

InitialTouchPosition

SwipeInitial position when starting to touch the trackpad

Protected variable

FTimespan

 

LastActiveTrackpadUpdateTime

Real time that the last trackpad position was over the dead zone threshold.

Protected variable

ETouchSwipeDire...

 

LastSwipe

Latest swipe direction on the trackpad

Protected variable

FVector2D

 

LastTrackpadPosition

Last position of the touched trackpad

Protected variable

FTimespan

 

LastTrackpadPositionUpdateTime

Real time that the last trackpad position was last updated. Used to filter out stale previous data.

Protected variable

TObjectPtr< cla...

 

MotionControllerComponent

Motion controller component which handles late-frame transform updates of all parented sub-components

Protected variable

FVector2D

 

TrackpadPosition

Position of the touched trackpad

Protected variable

TObjectPtr< cla...

 

VRMode

The mode that owns this interactor

Constructors

Name Description

Public function

UVREditorInteractor()

Default constructor

Functions

Name Description

Public function Const

FName

 

GetControllerHandSide()

Sets the EControllerHand for this motioncontroller

Public function Const

EControllerH...

 

GetControllerSide()

Get the side of the controller

Public function Const

EControllerT...

 

GetControllerType()

Returns what controller type this is for asymmetric control schemes

Public function Const

FName

 

GetHMDDeviceType()

Public function Const

const TMap< ...

 

GetKeyToActionMap()

Gets the key-to-action map (const)

Public function Const

const FVecto...

 

GetLaserEnd()

Public function Const

const FVecto...

 

GetLaserStart()

Getters and setters

Public function

FTimespan &

 

GetLastActiveTrackpadUpdateTime()

Get when the last time the trackpad position was updated

Public function Const

UWidgetCompo...

 

GetLastHoveredWidgetComponent()

Gets the current hovered widget component if any

Public function Const

FVector2D

 

GetLastTrackpadPosition()

Get the last position of the trackpad or analog stick

Public function

FTimespan &

 

GetLastTrackpadPositionUpdateTime()

Get when the last time the trackpad position was updated

Public function Const

double

 

GetLastUIPressTime()

Gets last time the interactor pressed on UI

Public function Const

UMotionContr...

 

GetMotionControllerComponent()

Get the motioncontroller component of this interactor

Public function Const

float

 

GetSelectAndMoveTriggerValue()

Gets the trigger value

Public function Const

float

 

GetSlideDelta()

Returns the slide delta for pushing and pulling objects.

Public function

AVREditorTel...

 

GetTeleportActor()

Public function Const

FVector2D

 

GetTrackpadPosition()

Get the current position of the trackpad or analog stick

Public function Const

float

 

GetTrackpadSlideDelta

(
    const bool Axis
)

Trackpad Gets the trackpad delta of the axis passed.

Public function Const

float

 

GetUIScrollVelocity()

Gets the UI scroll velocity

Public function

UVREditorMod...

 

GetVRMode()

Gets the owner of this system

Public function Const

const UVREdi...

 

GetVRMode()

Gets the owner of this system (const)

Public function Const

bool

 

HasUIOnForearm()

Check if the quick menu is on this interactor

Public function

void

 

Init

(
    UVREditorMode* InVRMode
)

Initialize default values

Public function Const

bool

 

IsCarrying()

Tells us if thie interator is carrying a "carryable" actor, like a camera, which matches the interactor motions instead of using manipulators.

Public function Const

bool

 

IsClickingOnUI()

Gets if the interactor is clicking on any UI

Public function Const

bool

 

IsHoveringOverUI()

Gets if this interactor is hovering over UI

Public function Const

bool

 

IsRightClickingOnUI()

Gets if the interactor is right clicking on UI

Public function Const

bool

 

IsScrubbingSequencer()

Returns whether or not this controller is being used to scrub sequencer

Public function Const

bool

 

IsTouchingTrackpad()

Check if the touchpad is currently touched

Public function Const

bool

 

IsTrackpadPositionValid

(
    const int32 AxisIndex
)

If the trackpad values are valid

Public function

void

 

ReplaceHandMeshComponent

(
    UStaticMesh* NewMesh
)

Replace the default VR controller mesh with a custom one.

Public function

void

 

ResetTrackpad()

Resets all the trackpad related values to default.

Public function

void

 

SetControllerHandSide

(
    const FName InControllerHandSide
)

Sets the EControllerHand for this motioncontroller

Public function

void

 

SetControllerType

(
    const EControllerType InControllerT...
)

Set what controller type this is for asymmetric control schemes

Public function

void

 

SetForceLaserColor

(
    const FLinearColor& InColor
)

Next frame this will be used as color for the laser

Public function

void

 

SetForceShowLaser

(
    const bool bInForceShow
)

Set if we want to force to show the laser

Public function

void

 

SetHasUIOnForearm

(
    const bool bInHasUIOnForearm
)

Sets if the quick menu is on this interactor

Public function

void

 

SetIsClickingOnUI

(
    const bool bInIsClickingOnUI
)

Sets if the interactor is clicking on any UI

Public function

void

 

SetIsHoveringOverUI

(
    const bool bInIsHoveringOverUI
)

Sets if the interactor is hovering over any UI

Public function

void

 

SetIsRightClickingOnUI

(
    const bool bInIsRightClickingOnUI
)

Sets if the interactor is right hover over any UI

Public function

void

 

SetLastHoveredWidgetComponent

(
    UWidgetComponent* NewHoveringO...
)

Sets the current hovered widget component

Public function

void

 

SetLastUIPressTime

(
    const double InLastUIPressTime
)

Sets the time the interactor last pressed on UI

Public function

void

 

SetUIScrollVelocity

(
    const float InUIScrollVelocity
)

Sets the UI scroll velocity

Public function

void

 

SetupComponent

(
    AActor* OwningActor
)

Sets up all components

Public function Virtual

void

 

Shutdown_Implementation()

Public function Virtual

void

 

Tick_Implementation

(
    const float DeltaTime
)

Public function

void

 

ToggleSequencerScrubbingMode()

Toggles whether or not this controller is being used to scrub sequencer

Public function

bool

 

TryOverrideControllerType

(
    const EControllerType InControllerT...
)

Temporary set what controller type this is for asymmetric control schemes.

Overridden from UViewportInteractor

Name Description

Public function Virtual

void

 

CalculateDragRay

(
    float& InOutDragRayLength,
    float& InOutDragRayVelocity
)

Needs to be implemented by the base to calculate drag ray length and the velocity for the ray

Public function Virtual

FHitResult

 

GetHitResultFromLaserPointer

(
    TArray< AActor* >* Option...,
    const EHitResultGizmoFilterMode Giz...,
    TArray< UClass* >* Object...,
    const bool bEvenIfBlocked,
    const float LaserLengthOverride
)

Traces along the laser pointer vector and returns what it first hits in the world

Public function Virtual Const

bool

 

GetIsLaserBlocked()

ViewportInteractor overrides, checks if the laser is blocked by UI

Public function Virtual Const

bool

 

GetTransformAndForwardVector

(
    FTransform& OutHandTransform,
    FVector& OutForwardVector
)

Creates a hand transform and forward vector for a laser pointer for a given hand

Public function Virtual

void

 

HandleInputAxis

(
    FEditorViewportClient& ViewportCli...,
    FViewportActionKeyInput& Action,
    const FKey Key,
    const float Delta,
    const float DeltaTime,
    bool& bOutWasHandled
)

To be overridden. Called by HandleInputAxis before delegates and default input implementation

Public function Virtual

void

 

HandleInputKey

(
    FEditorViewportClient& ViewportCli...,
    FViewportActionKeyInput& Action,
    const FKey Key,
    const EInputEvent Event,
    bool& bOutWasHandled
)

To be overridden. Called by HandleInputKey before delegates and default input implementation

Public function Virtual Const

bool

 

IsModifierPressed()

Public function Virtual

void

 

PlayHapticEffect

(
    const float Strength
)

Starts haptic feedback for physical motion controller

Protected function Virtual

void

 

PollInput()

Polls input for the motion controllers transforms

Public function Virtual

void

 

PreviewInputKey

(
    FEditorViewportClient& ViewportCli...,
    FViewportActionKeyInput& Action,
    const FKey Key,
    const EInputEvent Event,
    bool& bOutWasHandled
)

To be overridden. Called by HandleInputKey before delegates and default input implementation

Public function Virtual

void

 

ResetHoverState()

Reset the values before checking the hover actions

Constants