Navigation
API > API/Editor > API/Editor/ViewportInteraction
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UViewportInteractor
- UMouseCursorInteractor
- UVREditorInteractor
- UVRScoutingInteractor
References
| Module | ViewportInteraction |
| Header | /Engine/Source/Editor/ViewportInteraction/Public/ViewportInteractor.h |
| Include | #include "ViewportInteractor.h" |
Syntax
class UViewportInteractor : public UObject
Remarks
Represents the interactor in the world
Variables
| Type | Name | Description | |
|---|---|---|---|
| bool | bAllowGrabberSphere | True if this interactor supports 'grabber sphere' interaction. Usually disabled for mouse cursors | |
| bool | bCanCarry | True if this interactor can 'carry' objects in VR, that is, translation and rotation of the interactor is inherited by the object, instead of just translation | |
| FViewportInteractorData | InteractorData | All the private data for the interactor | |
| TMap< FKey, FViewportActionKeyInput > | KeyToActionMap | Mapping of raw keys to actions | |
| TObjectPtr< UViewportInteractor > | OtherInteractor | The paired interactor by the world interaction | |
| TOptional< FHitResult > | SavedHitResult | Store the last hitresult from the laser, to use that when calling GetHitResultFromLaserPointer multiple times in a tick. | |
| TOptional< EHitResultGizmoFilterMode > | SavedHitResultFilterMode | Store the last hitresult from the laser, to use that when calling GetHitResultFromLaserPointer multiple times in a tick. | |
| TOptional< FVector > | SavedLaserPointerEnd | Store end of the laser pointer. | |
| TObjectPtr< class UViewportWorldInteraction > | WorldInteraction | The owning world interaction |
Constructors
| Type | Name | Description | |
|---|---|---|---|
| Default constructor |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AddKeyAction
(
const FKey& Key, |
Adds a new action to the KeyToActionMap | |
| bool | If this interactors allows to smooth the laser. Default is true. | ||
| void | CalculateDragRay
(
double& InOutDragRayLength, |
Needs to be implemented by the base to calculate drag ray length and the velocity for the ray | |
| bool | CanCarry () |
Gets if the interactor can carry an object | |
| FViewportActionKeyInput * | GetActionWithName
(
const FName InActionName |
Gets a certain action by iterating through the map looking for the same ActionType | |
| EViewportInteractionDraggingMode | Gets the current interactor data dragging mode | ||
| float | Gets the drag haptic feedback strength console variable | ||
| FVector | Gets the interactor data drag velocity | ||
| bool | GetGrabberSphere
(
FSphere& OutGrabberSphere, |
Gets a sphere on this interactor that can be used to interact with objects in close proximity | |
| FHitResult | GetHitResultFromLaserPointer
(
TArray< AActor* >* OptionalListOfIgnoredActors, |
Traces along the laser pointer vector and returns what it first hits in the world | |
| EHitResultGizmoFilterMode | Gets current gizmo filter mode used for Interaction | ||
| FVector | Gets the interactor laser hover location | ||
| const FViewportInteractorData & | Gets the private data for this interactor (const) | ||
| FViewportInteractorData & | Gets the private data for this interactor | ||
| bool | To be overridden by base class. | ||
| bool | GetLaserPointer
(
FVector& LaserPointerStart, |
Gets the start and end point of the laser pointer for the specified hand | |
| float | Gets the maximum length of a laser pointer | ||
| EViewportInteractionDraggingMode | Gets the interactor data previous dragging mode | ||
| UActorComponent * | Gets the last component hovered on by the interactor laser. | ||
| FTransform | Gets the last hand transform of the interactor, in the local tracking space | ||
| FTransform | Gets the last world transform of this interactor | ||
| UViewportInteractor * | Gets the paired interactor assigned by the world interaction, can return null when there is no other interactor | ||
| FTransform | Gets the hand transform of the interactor, in the local tracking space | ||
| FTransform | GetTransform () |
Gets the world transform of this interactor | |
| bool | GetTransformAndForwardVector
(
FTransform& OutHandTransform, |
Creates a hand transform and forward vector for a laser pointer for a given hand | |
| UViewportWorldInteraction * | Gets the world interaction | ||
| void | HandleInputAxis
(
FEditorViewportClient& ViewportClient, |
To be overridden. Called by HandleInputAxis before delegates and default input implementation | |
| bool | HandleInputAxis
(
FEditorViewportClient& ViewportClient, |
Handles axis input and translates it to actions C++ Child classes are expected to to call there super versions of this. | |
| void | HandleInputAxis_BP
(
const FViewportActionKeyInput& Action, |
To be overridden. Called by HandleInputAxis before delegates and default input implementation | |
| void | HandleInputKey
(
FEditorViewportClient& ViewportClient, |
To be overridden. Called by HandleInputKey before delegates and default input implementation | |
| bool | HandleInputKey
(
FEditorViewportClient& ViewportClient, |
Handles key input and translates it actions C++ Child classes are expected to to call there super versions of this. | |
| void | HandleInputKey_BP
(
const FViewportActionKeyInput& Action, |
To be overridden. Called by HandleInputKey before delegates and default input implementation | |
| bool | IsHovering () |
If the interactor laser is currently hovering | |
| bool | If the interactor laser is currently hovering over a gizmo handle | ||
| bool | If this interactor is hovering over a type that has priority from GetHitResultFromLaserPointer | ||
| bool | Returns true if currently hovering over selected actor | ||
| bool | |||
| void | OnStartDragging
(
const FVector& HitLocation, |
Called by StartDragging in world interaction to give the interactor a chance of acting upon starting a drag operation | |
| void | PlayHapticEffect
(
const float Strength |
Triggers a force feedback effect on device if possible | |
| void | PollInput () |
Base classes need to implement getting the input for the input devices for that interactor | |
| void | PreviewInputAxis
(
FEditorViewportClient& ViewportClient, |
To be overridden. Called by HandleInputAxis before delegates and default input implementation | |
| void | PreviewInputKey
(
FEditorViewportClient& ViewportClient, |
To be overridden. Called by HandleInputKey before delegates and default input implementation | |
| void | RemoveKeyAction
(
const FKey& Key |
Removes an action from the KeyToActionMap | |
| void | Removes the other interactor reference for this interactor | ||
| void | Reset the values before checking the hover actions | ||
| void | Reset the stored laser end location at the end of tick | ||
| void | SetCanCarry
(
const bool bInCanCarry |
Sets if the interactor can carry an object | |
| void | SetDraggingMode
(
const EViewportInteractionDraggingMode NewDraggingMode |
Sets the current dragging mode for this interactor | |
| void | SetHitResultGizmoFilterMode
(
EHitResultGizmoFilterMode newFilter |
Sets the current gizmo filter mode used for Interaction | |
| void | SetHoverLocation
(
const FVector& InHoverLocation |
Sets the hover location | |
| void | SetOtherInteractor
(
UViewportInteractor* InOtherInteractor |
Sets the other interactor | |
| void | SetWorldInteraction
(
UViewportWorldInteraction* InWorldInteraction |
Sets the world interaction | |
| void | Shutdown () |
Whenever the ViewportWorldInteraction is shut down, the interacts will shut down as well | |
| void | Tick
(
const float DeltaTime |
Update for this interactor called by the ViewportWorldInteraction |
Deprecated Functions
| Type | Name | Description | |
|---|---|---|---|
| void | CalculateDragRay
(
float& InOutDragRayLength, |
CalculateDragRay() now uses double-precision arguments. | |
| FHitResult | GetHitResultFromLaserPointer
(
TArray< AActor* >* OptionalListOfIgnoredActors, |
bool bIgnoreGizmos replaced with EHitResultGizmoFilterMode GizmoFilterMode |