Navigation
API > API/Editor > API/Editor/ViewportInteraction
| Name | UViewportWorldInteraction |
| Type | class |
| Header File | /Engine/Source/Editor/ViewportInteraction/Public/ViewportWorldInteraction.h |
| Include Path | #include "ViewportWorldInteraction.h" |
Syntax
UCLASS (MinimalAPI, BlueprintType, Transient)
class UViewportWorldInteraction : public UEditorWorldExtension
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UEditorWorldExtension → UViewportWorldInteraction
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UViewportWorldInteraction() |
ViewportWorldInteraction.h |
Classes
| Name | Remarks |
|---|---|
| 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
Public
| Name | Remarks |
|---|---|
| EColors | Colors |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| AssetContainerPath | const TCHAR * | The path of the asset container | ViewportWorldInteraction.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ActorsToExcludeFromHitTest | TArray< TWeakObjectPtr< AActor > > | List of actors which should never be hit by an interactor, such as the 'avatar mesh actor' in VR | ViewportWorldInteraction.h | |
| AppTimeEntered | FTimespan | App time that we entered this | ViewportWorldInteraction.h | |
| AssetContainer | TObjectPtr< const UViewportInteractionAssetContainer > | Container of assets | ViewportWorldInteraction.h | |
| bAllowWorldMovement | bool | If the user can scale and navigate around in the world | ViewportWorldInteraction.h | |
| bAreTransformablesMoving | bool | Object movement/placement True if transformables are being moved around, including any inertial movement or movement caused by smooth snapping or placement interpolation. | ViewportWorldInteraction.h | |
| bFreezePlacementWhileInterpolatingTransformables | bool | When interpolating from a snapshot transform, this will be true if we should freeze the destination placement location until the interpolation finishes | ViewportWorldInteraction.h | |
| bIsInterpolatingTransformablesFromSnapshotTransform | bool | True if our transformables are currently interpolating to their target location | ViewportWorldInteraction.h | |
| bIsInVR | bool | VR If this world interaction is in VR | ViewportWorldInteraction.h | |
| bPlayNextRefreshTransformGizmoSound | bool | If we want to skip playing the sound when refreshing the transform gizmo next time | ViewportWorldInteraction.h | |
| bShouldForceCursor | bool | Whether or not to force the cursor on the viewport | ViewportWorldInteraction.h | |
| bShouldSuppressCursor | bool | Whether or not to show the cursor on the viewport | ViewportWorldInteraction.h | |
| bShouldTransformGizmoBeVisible | bool | Whether the gizmo should be visible or not | ViewportWorldInteraction.h | |
| bSkipInteractiveWorldMovementThisFrame | bool | True if we should skip interactive world movement/rotation/scaling this frame (because it was already set by something else) | ViewportWorldInteraction.h | |
| bUseInputPreprocessor | bool | If this world interaction should get input from the input processor | ViewportWorldInteraction.h | |
| CandidateActors | TArray< const AActor * > | Candidate actors for aligning in the scene | ViewportWorldInteraction.h | |
| Colors | TArray< FLinearColor > | All the colors for this mode. | ViewportWorldInteraction.h | |
| CurrentDeltaTime | float | The delta time of this tick | ViewportWorldInteraction.h | |
| CurrentTickNumber | uint32 | The current tick number | ViewportWorldInteraction.h | |
| DefaultMouseCursorInteractor | TObjectPtr< class UMouseCursorInteractor > | Interactors The default mouse cursor interactor, activated on demand | ViewportWorldInteraction.h | |
| DefaultMouseCursorInteractorRefCount | int32 | Reference count for the default mouse cursor interactor. | ViewportWorldInteraction.h | |
| DefaultOptionalViewportClient | FEditorViewportClient * | Viewport The viewport that the worldinteraction is used for | ViewportWorldInteraction.h | |
| DraggedInteractable | IViewportInteractableInterface * | Interactable The current dragged interactable | ViewportWorldInteraction.h | |
| GizmoLocalBounds | FBox | Current gizmo bounds in local space. | ViewportWorldInteraction.h | |
| GizmoType | TOptional< EGizmoHandleTypes > | The current gizmo type | ViewportWorldInteraction.h | |
| HighSpeedInertiaDamping | float | Storage for High speed damping value for when we're dragging ourself around the world | ViewportWorldInteraction.h | |
| HoveredObjects | TSet< FViewportHoverTarget > | Hover state Set of objects that are currently hovered over | ViewportWorldInteraction.h | |
| InputProcessor | TSharedPtr< class FViewportInteractionInputProcessor > | Slate Input Processor | ViewportWorldInteraction.h | |
| Interactors | TArray< TObjectPtr< class UViewportInteractor > > | All the interactors registered to modify the world | ViewportWorldInteraction.h | |
| LastCarryingTransform | TOptional< FTransform > | When carrying, the last position of the interactor that was carrying. Used for smoothing motion. | ViewportWorldInteraction.h | |
| LastFrameNumberInputWasPolled | uint32 | The last frame that input was polled. | ViewportWorldInteraction.h | |
| LastWorldToMetersScale | float | World movement The world to meters scale before we changed it (last frame's world to meters scale) | ViewportWorldInteraction.h | |
| LowSpeedInertiaDamping | float | Storage for Low speed damping value for when we're dragging ourself around the world | ViewportWorldInteraction.h | |
| MotionControllerID | int32 | The Unreal controller ID for the motion controllers we're using | ViewportWorldInteraction.h | |
| OnAxisInputEvent | FOnHandleInputAxis | Event that is fired when new axis input is received by the InputProcessor | ViewportWorldInteraction.h | |
| OnFinishedMovingTransformablesEvent | FOnFinishedMovingTransformables | Event for when the current set of transformables has finally stop moving (after a drag, and all inertial effects or snapping interpolation has completed | ViewportWorldInteraction.h | |
| OnHoverUpdateEvent | FOnVIHoverUpdate | Events Event that fires every frame to update hover state based on what's under the cursor. | ViewportWorldInteraction.h | |
| OnInputActionEvent | FOnVIActionHandle | Event that is fired for when a key is pressed by an interactor | ViewportWorldInteraction.h | |
| OnKeyInputEvent | FOnHandleInputKey | Event that is fired when new key input is received by the InputProcessor | ViewportWorldInteraction.h | |
| OnPostWorldInteractionTickEvent | FOnViewportWorldInteractionTick | Event to tick after the worldinteraction has ticked | ViewportWorldInteraction.h | |
| OnPreviewInputActionEvent | FOnPreviewInputAction | Event for previewing input actions. | ViewportWorldInteraction.h | |
| OnPreWorldInteractionTickEvent | FOnViewportWorldInteractionTick | Event to tick before the worldinteraction ticks | ViewportWorldInteraction.h | |
| OnStartDraggingEvent | FOnStartDragging | Event that is fired when an interactor starts dragging | ViewportWorldInteraction.h | |
| OnStopDraggingEvent | FOnStopDragging | Event that is fired when an interactor stopped dragging | ViewportWorldInteraction.h | |
| OnViewportInteractionInputUnhandledEvent | FOnViewportInteractionInputUnhandled | Called when the user clicks on 'nothing' to request systems to deselect anything that's selected | ViewportWorldInteraction.h | |
| OnWorldScaleChangedEvent | FOnWorldScaleChanged | Configuration Event that is fired when the world scale changes | ViewportWorldInteraction.h | |
| RoomTransformToSetOnFrame | TOptional< TTuple< FTransform, uint32 > > | The room transform to apply at the beginning of the next frame (if needed.) This is used to defer updates of the room transform to match with the GNewWorldToMetersScale, which will also take effect on the next frame. | ViewportWorldInteraction.h | |
| SnapGridActor | TObjectPtr< class AActor > | Snap grid Actor for the snap grid | ViewportWorldInteraction.h | |
| SnapGridMeshComponent | TObjectPtr< class UStaticMeshComponent > | The plane mesh we use to draw a snap grid under selected objects | ViewportWorldInteraction.h | |
| SnapGridMID | TObjectPtr< class UMaterialInstanceDynamic > | MID for the snap grid, so we can update snap values on the fly | ViewportWorldInteraction.h | |
| Transformables | TArray< TUniquePtr< FViewportTransformable > > | All of the objects we're currently interacting with, such as selected actors | ViewportWorldInteraction.h | |
| TransformablesInterpolationDuration | float | Duration to interpolate transformables over | ViewportWorldInteraction.h | |
| TransformablesInterpolationStartTime | FTimespan | Time that we started interpolating at | ViewportWorldInteraction.h | |
| TransformGizmoActor | TObjectPtr< class ABaseTransformGizmo > | Transform gizmo Transform gizmo actor, for manipulating selected actor(s) | ViewportWorldInteraction.h | |
| TransformGizmoClass | TSubclassOf< ABaseTransformGizmo > | Class used for when refreshing the transform gizmo | ViewportWorldInteraction.h | |
| TransformGizmoScale | float | How big the transform gizmo should be | ViewportWorldInteraction.h | |
| ViewportTransformer | TObjectPtr< class UViewportTransformer > | The active system being used to transform objects | ViewportWorldInteraction.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddActorToExcludeFromHitTests
(
AActor* ActorToExcludeFromHitTests |
Adds an actor to the list of actors to never allow an interactor to hit in the scene. | ViewportWorldInteraction.h |
|
void AddInteractor
(
UViewportInteractor* Interactor |
Adds interactor to the worldinteraction | ViewportWorldInteraction.h |
|
void AddMouseCursorInteractor () |
Creates an interactor for the mouse cursor. | ViewportWorldInteraction.h | |
void AllowWorldMovement
(
bool bAllow |
The ability to move and scale the world | ViewportWorldInteraction.h | |
void ApplyVelocityDamping
(
FVector& Velocity, |
Given a world space velocity vector, applies inertial damping to it to slow it down | ViewportWorldInteraction.h | |
bool AreAligningToActors() |
For other systems to check if the Viewport World Interaction system is currently aligning transformables to actors | ViewportWorldInteraction.h | |
void Copy() |
Copies selected objects to the clipboard | ViewportWorldInteraction.h | |
void CycleTransformGizmoCoordinateSpace() |
Switch which transform gizmo coordinate space we're using. | ViewportWorldInteraction.h | |
void DeleteSelectedObjects() |
Deletes all the selected objects | ViewportWorldInteraction.h | |
void Deselect() |
Deselects all the current selected objects | ViewportWorldInteraction.h | |
void Duplicate() |
Duplicates the selected objects | ViewportWorldInteraction.h | |
bool FindPlacementPointUnderLaser
(
UViewportInteractor* Interactor, |
Figures out where to place an object when tracing it against the scene using a laser pointer | ViewportWorldInteraction.h | |
const TArray< TWeakObjectPtr< AActor > > & GetActorsToExcludeFromHitTest() |
ViewportWorldInteraction.h | ||
const UViewportInteractionAssetContainer & GetAssetContainer() |
Gets the container for all the assets of ViewportInteraction. | ViewportWorldInteraction.h | |
FLinearColor GetColor
(
const EColors Color, |
Gets the color from color type | ViewportWorldInteraction.h | |
float GetCurrentDeltaTime() |
Gets the current delta time, so functions that don't get the delta time passed can still get it | ViewportWorldInteraction.h | |
EGizmoHandleTypes GetCurrentGizmoType() |
Gets the current Gizmo handle type | ViewportWorldInteraction.h | |
FEditorViewportClient * GetDefaultOptionalViewportClient() |
Gets the currently used viewport | ViewportWorldInteraction.h | |
FTransform GetHeadTransform() |
Gets the transform of the viewport / user's HMD in world space | ViewportWorldInteraction.h |
|
const TArray< UViewportInteractor * > & GetInteractors() |
Gets all the interactors | ViewportWorldInteraction.h |
|
float GetMaxScale() |
Returns the maximum user scale | ViewportWorldInteraction.h | |
float GetMinScale() |
Returns the minimum user scale | ViewportWorldInteraction.h | |
int32 GetMotionControllerID() |
Returns the Unreal controller ID for the motion controllers we're using | ViewportWorldInteraction.h | |
FTransform GetRoomSpaceHeadTransform() |
Gets the transform of the viewport / user's HMD in room space | ViewportWorldInteraction.h |
|
FTransform GetRoomTransform () |
Gets the world space transform of the calibrated VR room origin. | ViewportWorldInteraction.h |
|
FTrackingTransaction & GetTrackingTransaction() |
Gets the tracking transactions | ViewportWorldInteraction.h | |
TArray< TUniquePtr< FViewportTransformable > > & GetTransformables() |
Gets a list of all of the objects we're currently interacting with, such as selected actors | ViewportWorldInteraction.h | |
const UViewportTransformer * GetTransformer() |
ViewportWorldInteraction.h | ||
ABaseTransformGizmo * GetTransformGizmoActor() |
Gets the transform gizmo actor, or returns null if we currently don't have one | ViewportWorldInteraction.h |
|
ECoordSystem GetTransformGizmoCoordinateSpace() |
Returns which transform gizmo coordinate space we're using, world or local | ViewportWorldInteraction.h | |
float GetTransformGizmoScale() |
Returns the current transform gizmo scale | ViewportWorldInteraction.h | |
float GetWorldScaleFactor() |
Gets the world scale factor, which can be multiplied by a scale vector to convert to room space | ViewportWorldInteraction.h |
|
bool HasCandidatesSelected() |
For other systems to check if the Viewport World Interaction system currently has candidate actors selected | ViewportWorldInteraction.h | |
bool HaveHeadTransform() |
Returns true if we actually are using VR and have a valid head location, meaning a call to GetHeadTransform() is valid | ViewportWorldInteraction.h | |
virtual void Init() |
ViewportWorldInteraction.h | ||
void InitColors() |
Initialize colors | ViewportWorldInteraction.h | |
| ViewportWorldInteraction.h | |||
virtual bool InputKey
(
FEditorViewportClient* InViewportClient, |
Input | ViewportWorldInteraction.h | |
bool IsInteractableComponent
(
const UActorComponent* Component |
Checks to see if we're allowed to interact with the specified component | ViewportWorldInteraction.h | |
bool IsInVR() |
Get if this world interaction is in VR. | ViewportWorldInteraction.h | |
bool IsOtherInteractorHoveringOverComponent
(
UViewportInteractor* Interactor, |
Check if there is another interactor hovering over the component | ViewportWorldInteraction.h | |
bool IsTransformGizmoVisible () |
Returns whether the transform gizmo is actually visible right now. | ViewportWorldInteraction.h | |
FOnFinishedMovingTransformables & OnFinishedMovingTransformables() |
ViewportWorldInteraction.h | ||
FOnHandleInputAxis & OnHandleAxisInput() |
ViewportWorldInteraction.h | ||
FOnHandleInputKey & OnHandleKeyInput() |
ViewportWorldInteraction.h | ||
FOnViewportWorldInteractionTick & OnPostWorldInteractionTick() |
ViewportWorldInteraction.h | ||
FOnPreviewInputAction & OnPreviewInputAction() |
ViewportWorldInteraction.h | ||
FOnViewportWorldInteractionTick & OnPreWorldInteractionTick() |
ViewportWorldInteraction.h | ||
FOnStartDragging & OnStartDragging() |
ViewportWorldInteraction.h | ||
FOnStopDragging & OnStopDragging() |
ViewportWorldInteraction.h | ||
FOnVIHoverUpdate & OnViewportInteractionHoverUpdate() |
ViewportWorldInteraction.h | ||
FOnVIActionHandle & OnViewportInteractionInputAction() |
ViewportWorldInteraction.h | ||
FOnViewportInteractionInputUnhandled & OnViewportInteractionInputUnhandled() |
ViewportWorldInteraction.h | ||
virtual FOnWorldScaleChanged & OnWorldScaleChanged() |
ViewportWorldInteraction.h | ||
void PairInteractors
(
UViewportInteractor* FirstInteractor, |
Pairs to interactors by setting the other interactor for each interactor | ViewportWorldInteraction.h | |
void Paste() |
Pastes the clipboard contents into the scene | ViewportWorldInteraction.h | |
void PlaySound
(
USoundBase* SoundBase, |
Plays sound at location. | ViewportWorldInteraction.h | |
bool PreprocessedInputAxis
(
const int32 ControllerId, |
Handles the axis input from the Input Preprocessor | ViewportWorldInteraction.h | |
bool PreprocessedInputKey
(
const FKey Key, |
Handles the key input from the Input Preprocessor | ViewportWorldInteraction.h | |
void Redo() |
Redoes the last change | ViewportWorldInteraction.h | |
void ReleaseMouseCursorInteractor () |
When you're finished with the mouse cursor interactor, call this to release it. | ViewportWorldInteraction.h | |
void RemoveInteractor
(
UViewportInteractor* Interactor |
Removes interactor from the worldinteraction and removes the interactor from its paired interactor if any | ViewportWorldInteraction.h |
|
void SetDefaultOptionalViewportClient
(
const TSharedPtr< class FEditorViewportClient >& InEditorViewportClient |
When using VR, this sets the viewport client that's been "possessed" by the head mounted display. | ViewportWorldInteraction.h | |
void SetDraggedInteractable
(
IViewportInteractableInterface* InDraggedInteractable, |
Sets the currently dragged interactavle | ViewportWorldInteraction.h | |
void SetDraggedSinceLastSelection
(
const bool bNewDraggedSinceLastSelection |
Sets if objects are dragged with either hand since last time selecting something | ViewportWorldInteraction.h | |
void SetForceCursor
(
const bool bInShouldForceCursor |
ViewportWorldInteraction.h | ||
void SetGizmoHandleType
(
const EGizmoHandleTypes InGizmoHandleType |
Sets the current gizmo handle type | ViewportWorldInteraction.h | |
void SetHeadTransform
(
const FTransform& NewHeadTransform |
Sets a new transform for the room so that the HMD is aligned to the new transform. | ViewportWorldInteraction.h |
|
void SetInVR
(
const bool bInVR |
Set if this world interaction is in VR. | ViewportWorldInteraction.h | |
void SetLastDragGizmoStartTransform
(
const FTransform NewLastDragGizmoStartTransform |
Sets the transform of the gizmo when starting drag | ViewportWorldInteraction.h | |
void SetRoomTransform
(
const FTransform& NewRoomTransform |
Sets a new transform for the room, in world space. | ViewportWorldInteraction.h | |
void SetRoomTransformForNextFrame
(
const FTransform& NewRoomTransform |
ViewportWorldInteraction.h |
|
|
void SetSelectionAsCandidates () |
If there are no currently selected candidates, use the currently selected actors as candidates. | ViewportWorldInteraction.h | |
void SetShouldSuppressExistingCursor
(
const bool bInShouldSuppressCursor |
ViewportWorldInteraction.h | ||
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 | ViewportWorldInteraction.h | |
void SetTransformer
(
UViewportTransformer* NewTransformer |
Sets the system that should be used to transform objects in the scene. | ViewportWorldInteraction.h | |
void SetTransformGizmoClass
(
const TSubclassOf< ABaseTransformGizmo >& NewTransformGizmoClass |
Changes the transform gizmo class that it will change to next refresh | ViewportWorldInteraction.h | |
void SetTransformGizmoCoordinateSpace
(
const ECoordSystem NewCoordSystem |
Sets which transform gizmo coordinate space is used | ViewportWorldInteraction.h | |
void SetTransformGizmoScale
(
const float NewScale |
Sets how large the transform gizmo is | ViewportWorldInteraction.h | |
void SetTransformGizmoVisible
(
const bool bShouldBeVisible |
Sets whether the transform gizmo should be visible at all | ViewportWorldInteraction.h | |
void SetUseInputPreprocessor
(
bool bInUseInputPreprocessor |
Sets whether we should allow input events from the input preprocessor or not | ViewportWorldInteraction.h | |
void SetWorldToMetersScale
(
const float NewWorldToMetersScale, |
Sets GNewWorldToMetersScale | ViewportWorldInteraction.h |
|
bool ShouldForceCursor() |
Getters and setters for whether or not to show the cursor on the viewport | ViewportWorldInteraction.h | |
bool ShouldSuppressExistingCursor() |
Getters and setters for whether or not to show the cursor on the viewport | ViewportWorldInteraction.h | |
bool ShouldTransformGizmoBeVisible() |
Returns whether the transform gizmo should be visible | ViewportWorldInteraction.h | |
virtual void Shutdown() |
ViewportWorldInteraction.h | ||
| Tells the world interaction system to skip updates of world movement this frame. | ViewportWorldInteraction.h | ||
FVector SnapLocation
(
const bool bLocalSpaceSnapping, |
ViewportWorldInteraction.h | ||
void StartDragging
(
UViewportInteractor* Interactor, |
Starts dragging selected objects around. | ViewportWorldInteraction.h | |
void StopDragging
(
UViewportInteractor* Interactor |
Called to finish a drag action with the specified interactor | ViewportWorldInteraction.h | |
virtual void Tick
(
float DeltaSeconds |
ViewportWorldInteraction.h | ||
void Undo() |
Invokes the editor's undo system to undo the last change | ViewportWorldInteraction.h | |
void UseLegacyInteractions() |
Forces the VWI to fall back to standard desktop interactions | ViewportWorldInteraction.h | |
void UseVWInteractions() |
Sets the VWI to use its own interactions | ViewportWorldInteraction.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void EnteredSimulateInEditor() |
ViewportWorldInteraction.h | ||
virtual void LeftSimulateInEditor
(
UWorld* SimulateWorld |
ViewportWorldInteraction.h | ||
virtual void TransitionWorld
(
UWorld* NewWorld, |
ViewportWorldInteraction.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static const UViewportInteractionAssetContainer * LoadAssetContainer() |
Static function to load the asset container | ViewportWorldInteraction.h |