Navigation
API > API/Editor > API/Editor/ViewportInteraction
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UEditorWorldExtension
- UViewportWorldInteraction
References
| Module | ViewportInteraction |
| Header | /Engine/Source/Editor/ViewportInteraction/Public/ViewportWorldInteraction.h |
| Include | #include "ViewportWorldInteraction.h" |
Syntax
class UViewportWorldInteraction : public UEditorWorldExtension
Variables
| Type | Name | Description | |
|---|---|---|---|
| bool | bDraggedSinceLastSelection | True if we've dragged objects with either hand since the last time we selected something | |
| FTransform | LastDragGizmoStartTransform | Gizmo start transform of the last drag we did with either hand. | |
| FTrackingTransaction | TrackingTransaction | Undo/redoManages saving undo for selected actors while we're dragging them around |
Constructors
| Type | Name | Description | |
|---|---|---|---|
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AddActorToExcludeFromHitTests
(
AActor* ActorToExcludeFromHitTests |
Adds an actor to the list of actors to never allow an interactor to hit in the scene. | |
| void | AddInteractor
(
UViewportInteractor* Interactor |
Adds interactor to the worldinteraction | |
| void | Creates an interactor for the mouse cursor. | ||
| void | AllowWorldMovement
(
bool bAllow |
The ability to move and scale the world | |
| void | ApplyVelocityDamping
(
FVector& Velocity, |
Given a world space velocity vector, applies inertial damping to it to slow it down | |
| bool | For other systems to check if the Viewport World Interaction system is currently aligning transformables to actors | ||
| void | Copy () |
Copies selected objects to the clipboard | |
| void | Switch which transform gizmo coordinate space we're using. | ||
| void | Deletes all the selected objects | ||
| void | Deselect () |
Deselects all the current selected objects | |
| void | Duplicate () |
Duplicates the selected objects | |
| bool | FindPlacementPointUnderLaser
(
UViewportInteractor* Interactor, |
Figures out where to place an object when tracing it against the scene using a laser pointer | |
| const TArray< TWeakObjectPtr< AActor > > & | |||
| const UViewportInteractionAssetContainer & | Gets the container for all the assets of ViewportInteraction. | ||
| FLinearColor | Gets the color from color type | ||
| float | Gets the current delta time, so functions that don't get the delta time passed can still get it | ||
| EGizmoHandleTypes | Gets the current Gizmo handle type | ||
| FEditorViewportClient * | Gets the currently used viewport | ||
| FTransform | Gets the transform of the viewport / user's HMD in world space | ||
| const TArray< UViewportInteractor * > & | Gets all the interactors | ||
| float | GetMaxScale () |
Returns the maximum user scale | |
| float | GetMinScale () |
Returns the minimum user scale | |
| int32 | Returns the Unreal controller ID for the motion controllers we're using | ||
| FTransform | Gets the transform of the viewport / user's HMD in room space | ||
| FTransform | Gets the world space transform of the calibrated VR room origin. | ||
| FTrackingTransaction & | Gets the tracking transactions | ||
| TArray< TUniquePtr< FViewportTransformable > > & | Gets a list of all of the objects we're currently interacting with, such as selected actors | ||
| const UViewportTransformer * | |||
| ABaseTransformGizmo * | Gets the transform gizmo actor, or returns null if we currently don't have one | ||
| ECoordSystem | Returns which transform gizmo coordinate space we're using, world or local | ||
| float | Returns the current transform gizmo scale | ||
| float | Gets the world scale factor, which can be multiplied by a scale vector to convert to room space | ||
| bool | For other systems to check if the Viewport World Interaction system currently has candidate actors selected | ||
| bool | Returns true if we actually are using VR and have a valid head location, meaning a call to GetHeadTransform() is valid | ||
| void | InitColors () |
Initialize colors | |
| bool | IsInteractableComponent
(
const UActorComponent* Component |
Checks to see if we're allowed to interact with the specified component | |
| bool | IsInVR () |
Get if this world interaction is in VR. | |
| bool | IsOtherInteractorHoveringOverComponent
(
UViewportInteractor* Interactor, |
Check if there is another interactor hovering over the component | |
| bool | Returns whether the transform gizmo is actually visible right now. | ||
| const UViewportInteractionAssetContainer * | Static function to load the asset container | ||
| FOnFinishedMovingTransformables & | |||
| FOnHandleInputAxis & | |||
| FOnHandleInputKey & | |||
| FOnViewportWorldInteractionTick & | |||
| FOnPreviewInputAction & | |||
| FOnViewportWorldInteractionTick & | |||
| FOnStartDragging & | |||
| FOnStopDragging & | |||
| FOnVIHoverUpdate & | |||
| FOnVIActionHandle & | |||
| FOnViewportInteractionInputUnhandled & | |||
| FOnWorldScaleChanged & | |||
| void | PairInteractors
(
UViewportInteractor* FirstInteractor, |
Pairs to interactors by setting the other interactor for each interactor | |
| void | Paste () |
Pastes the clipboard contents into the scene | |
| void | PlaySound
(
USoundBase* SoundBase, |
Plays sound at location. | |
| bool | PreprocessedInputAxis
(
const int32 ControllerId, |
Handles the axis input from the Input Preprocessor | |
| bool | PreprocessedInputKey
(
const FKey Key, |
Handles the key input from the Input Preprocessor | |
| void | Redo () |
Redoes the last change | |
| void | When you're finished with the mouse cursor interactor, call this to release it. | ||
| void | RemoveInteractor
(
UViewportInteractor* Interactor |
Removes interactor from the worldinteraction and removes the interactor from its paired interactor if any | |
| void | SetDefaultOptionalViewportClient
(
const TSharedPtr< class FEditorViewportClient >& InEditorViewportClient |
When using VR, this sets the viewport client that's been "possessed" by the head mounted display. | |
| void | SetDraggedInteractable
(
IViewportInteractableInterface* InDraggedInteractable, |
Sets the currently dragged interactavle | |
| void | SetDraggedSinceLastSelection
(
const bool bNewDraggedSinceLastSelection |
Sets if objects are dragged with either hand since last time selecting something | |
| void | SetForceCursor
(
const bool bInShouldForceCursor |
||
| void | SetGizmoHandleType
(
const EGizmoHandleTypes InGizmoHandleType |
Sets the current gizmo handle type | |
| void | SetHeadTransform
(
const FTransform& NewHeadTransform |
Sets a new transform for the room so that the HMD is aligned to the new transform. | |
| void | SetInVR
(
const bool bInVR |
Set if this world interaction is in VR. | |
| void | SetLastDragGizmoStartTransform
(
const FTransform NewLastDragGizmoStartTransform |
Sets the transform of the gizmo when starting drag | |
| void | SetRoomTransform
(
const FTransform& NewRoomTransform |
Sets a new transform for the room, in world space. | |
| void | SetRoomTransformForNextFrame
(
const FTransform& NewRoomTransform |
||
| void | If there are no currently selected candidates, use the currently selected actors as candidates. | ||
| void | SetShouldSuppressExistingCursor
(
const bool bInShouldSuppressCursor |
Getters and setters for whether or not to show the cursor on the viewport | |
| void | SetTransformables
(
TArray< TUniquePtr< FViewportTransformable > >&& NewTransformables, |
Sets the list of objects that this system will be responsible for transforming when interacting using the gizmo or directly on the objects | |
| void | SetTransformer
(
UViewportTransformer* NewTransformer |
Sets the system that should be used to transform objects in the scene. | |
| void | SetTransformGizmoClass
(
const TSubclassOf< ABaseTransformGizmo >& NewTransformGizmoClass |
Changes the transform gizmo class that it will change to next refresh | |
| void | SetTransformGizmoCoordinateSpace
(
const ECoordSystem NewCoordSystem |
Sets which transform gizmo coordinate space is used | |
| void | SetTransformGizmoScale
(
const float NewScale |
Sets how large the transform gizmo is | |
| void | SetTransformGizmoVisible
(
const bool bShouldBeVisible |
Sets whether the transform gizmo should be visible at all | |
| void | SetUseInputPreprocessor
(
bool bInUseInputPreprocessor |
Sets whether we should allow input events from the input preprocessor or not | |
| void | SetWorldToMetersScale
(
const float NewWorldToMetersScale, |
Sets GNewWorldToMetersScale | |
| bool | Getters and setters for whether or not to show the cursor on the viewport | ||
| bool | Getters and setters for whether or not to show the cursor on the viewport | ||
| bool | Returns whether the transform gizmo should be visible | ||
| void | Tells the world interaction system to skip updates of world movement this frame. | ||
| FVector | SnapLocation
(
const bool bLocalSpaceSnapping, |
||
| void | StartDragging
(
UViewportInteractor* Interactor, |
Starts dragging selected objects around. | |
| void | StopDragging
(
UViewportInteractor* Interactor |
Called to finish a drag action with the specified interactor | |
| void | Undo () |
Invokes the editor's undo system to undo the last change | |
| void | Forces the VWI to fall back to standard desktop interactions | ||
| void | Sets the VWI to use its own interactions |
Overridden from UEditorWorldExtension
| Type | Name | Description | |
|---|---|---|---|
| void | Give child class a chance to act on entering simulate mode | ||
| void | Init () |
Initialize extension | |
| bool | InputAxis
(
FEditorViewportClient* InViewportClient, |
||
| bool | InputKey
(
FEditorViewportClient* InViewportClient, |
Input | |
| void | LeftSimulateInEditor
(
UWorld* SimulateWorld |
Give child class a chance to act on leaving simulate mode | |
| void | Shutdown () |
Shut down extension when world is destroyed | |
| void | Tick
(
float DeltaSeconds |
Give base class the chance to tick | |
| void | TransitionWorld
(
UWorld* NewWorld, |
Reparent actors to a new world |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FOnFinishedMovingTransformables | Gets the event for when the current set of transformables has finally stop moving (after a drag, and all inertial effects or snapping interpolation has completed | ||
| FOnHandleInputAxis | To handle raw axis input from the Input Preprocessor | ||
| FOnHandleInputKey | To handle raw key input from the Input Preprocessor | ||
| FOnPreviewInputAction | Gets the event for previewing input actions. | ||
| FOnStartDragging | Gets the event for when an interactor starts dragging | ||
| FOnStopDragging | Gets the event for when an interactor stops dragging | ||
| FOnVIActionHandle | Gets the event for input actions update which is broadcasted for each interactor | ||
| FOnViewportInteractionInputUnhandled | Called when the user clicks on 'nothing' to allow systems to deselect anything that's selected | ||
| FOnViewportWorldInteractionTick | |||
| FOnVIHoverUpdate | Gets the event for hovering update which is broadcasted for each interactor | ||
| FOnWorldScaleChanged |
Enums
| Type | Name | Description | |
|---|---|---|---|
| EColors | Colors |
Constants
| Name | Description |
|---|---|
| AssetContainerPath | The path of the asset container |