Navigation
API > API/Editor > API/Editor/VREditor
VR Editor Mode. Extends editor viewports with functionality for VR controls and object manipulation
| Name | UVREditorMode |
| Type | class |
| Header File | /Engine/Source/Editor/VREditor/Public/VREditorMode.h |
| Include Path | #include "VREditorMode.h" |
Syntax
UCLASS (Abstract, Transient)
class UVREditorMode : public UVREditorModeBase
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UEditorWorldExtension → UVREditorModeBase → UVREditorMode
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UVREditorMode() |
Default constructor | VREditorMode.h |
Classes
| Name | Remarks |
|---|---|
| FOnPlaceDraggedMaterial | Delegate to be called when a material is placed |
| FOnPlacePreviewActor | Delegate to be called when a preview actor is placed |
| FOnToggleVRModeDebug | Delegate to be called when the debug mode is toggled. |
| FOnVRTickHandle | * Gets the tick handle to give external systems the change to be ticked right after the ViewportWorldInteraction is ticked |
Structs
| Name | Remarks |
|---|---|
| FSavedEditorState | Saved information about the editor and viewport we possessed, so we can restore it after exiting VR mode |
Enums
Public
| Name | Remarks |
|---|---|
| EColors | Color types. |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FOnVREditingModeExit | TBaseDelegate_NoParams< void > | VREditorMode.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| AssetContainerPath | const TCHAR * | The asset container path | VREditorMode.h |
| bDebugModeEnabled | bool | Whether currently in debug mode or not. | VREditorMode.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| InteractorClass | TSoftClassPtr< UVREditorInteractor > | The controller to use when UnrealEd is in VR mode. | VREditorMode.h |
|
| OnVREditingModeExit_Handler | FOnVREditingModeExit | Used to override dockable area restoration behavior | VREditorMode.h | |
| TeleporterClass | TSoftClassPtr< AVREditorTeleporter > | The teleporter to use when UnrealEd is in VR mode. | VREditorMode.h |
|
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AssetContainer | TObjectPtr< class UVREditorAssetContainer > | Container of assets | VREditorMode.h | |
| bAddedViewportWorldInteractionExtension | bool | VREditorMode.h | ||
| bFirstTick | bool | If this is the first tick or before | VREditorMode.h | |
| Colors | TArray< FLinearColor > | All the colors for this mode. | VREditorMode.h | |
| CurrentSequencer | ISequencer * | Pointer to the current Sequencer | VREditorMode.h | |
| HMDDeviceTypeOverride | FName | Overridden HMD device type. If NAME_None, HMD device type is derived from the XR system name. | VREditorMode.h | |
| OnToggleDebugModeEvent | FOnToggleVRModeDebug | Event that gets broadcasted when debug mode is toggled. | VREditorMode.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AllocateInteractors() |
VREditorMode.h | ||
UStaticMeshComponent * CreateMesh
(
AActor* OwningActor, |
Helper functions to create a static mesh | VREditorMode.h | |
UStaticMeshComponent * CreateMesh
(
AActor* OwningActor, |
VREditorMode.h | ||
UStaticMeshComponent * CreateMotionControllerMesh
(
AActor* OwningActor, |
Create a static motion controller mesh for the current HMD platform | VREditorMode.h | |
void CycleTransformGizmoHandleType() |
Will update the TransformGizmo Actor with the next Gizmo type | VREditorMode.h | |
const UVREditorAssetContainer & GetAssetContainer() |
Gets the container for all the assets of VREditor. | VREditorMode.h | |
FLinearColor GetColor
(
const EColors Color |
Gets the color. | VREditorMode.h | |
EGizmoHandleTypes GetCurrentGizmoType() |
Gets the current Gizmo handle type | VREditorMode.h | |
ISequencer * GetCurrentSequencer() |
Returns the currently active sequencer | VREditorMode.h | |
float GetDefaultVRNearClipPlane() |
Get the default near clipping plane for VR editing. | VREditorMode.h | |
UVREditorInteractor * GetHandInteractor
(
const EControllerHand ControllerHand |
Gets the hand interactor | VREditorMode.h | |
FName GetHMDDeviceType() |
VREditorMode.h | ||
int32 GetMotionControllerID() |
Returns the Unreal controller ID for the motion controllers we're using | VREditorMode.h | |
FTransform GetRoomSpaceHeadTransform() |
Gets the transform of the user's HMD in room space | VREditorMode.h | |
const FSavedEditorState & GetSavedEditorState() |
Gets the saved editor state from entering the mode | VREditorMode.h | |
AVREditorTeleporter * GetTeleportActor() |
Get Teleporter | VREditorMode.h | |
FTimespan GetTimeSinceModeEntered() |
Returns the time since the VR Editor mode was last entered | VREditorMode.h | |
| Gets access to the VR UI system | VREditorMode.h | ||
const UVREditorUISystem & GetUISystem () |
Gets access to the VR UI system (const) | VREditorMode.h | |
const TArray< UVREditorInteractor * > GetVRInteractors() |
VREditorMode.h | ||
const UViewportWorldInteraction & GetWorldInteraction () |
Gets access to the world interaction system (const) | VREditorMode.h | |
| Gets access to the world interaction system | VREditorMode.h | ||
float GetWorldScaleFactor() |
Gets the world scale factor, which can be multiplied by a scale vector to convert to room space | VREditorMode.h |
|
bool IsAimingTeleport() |
Return true if currently aiming to teleport. | VREditorMode.h | |
bool IsFlashlightOn() |
Returns whether or not the flashlight is visible | VREditorMode.h | |
bool IsFullyInitialized() |
If the mode was completely initialized | VREditorMode.h | |
bool IsHandAimingTowardsCapsule
(
UViewportInteractor* Interactor, |
VREditorMode.h | ||
bool IsInGameView() |
Returns whether game view is currently active. | VREditorMode.h |
|
bool IsShowingRadialMenu
(
const UVREditorInteractor* Interactor |
Lets other modules know if the radial menu is visible on a given interactor so input should be handled differently | VREditorMode.h | |
bool IsTeleporting() |
VREditorMode.h | ||
virtual bool NeedsSyntheticDpad() |
VREditorMode.h | ||
FOnPlaceDraggedMaterial & OnPlaceDraggedMaterial() |
VREditorMode.h | ||
FOnPlacePreviewActor & OnPlacePreviewActor() |
VREditorMode.h | ||
FOnVRTickHandle & OnTickHandle() |
VREditorMode.h | ||
FOnToggleVRModeDebug & OnToggleDebugMode() |
VREditorMode.h | ||
void PlaySound
(
USoundBase* SoundBase, |
Plays sound at location. | VREditorMode.h | |
void PostTick
(
const float DeltaTime |
Tick after the ViewportWorldInteraction is ticked | VREditorMode.h | |
void PreTick
(
const float DeltaTime |
Tick before the ViewportWorldInteraction is ticked | VREditorMode.h | |
void RefreshActorPreviewWidget
(
TSharedRef< SWidget > InWidget, |
Refresh the current actor preview widget on an in-world UI panel | VREditorMode.h | |
void RefreshVREditorSequencer
(
ISequencer* InCurrentSequencer |
Runtime and plugin modules can force VR Editor to refresh using this function | VREditorMode.h | |
void SaveSequencerSettings
(
bool bInKeyAllEnabled, |
VREditorMode.h | ||
void SetGameView
(
bool bGameView |
Display the scene more closely to how it would appear at runtime (as opposed to edit time). | VREditorMode.h |
|
void SetHMDDeviceTypeOverride
(
FName InOverrideType |
Overrides the HMD device type, which is otherwise derived from the XR system name. | VREditorMode.h | |
void SetRoomTransform
(
const FTransform& NewRoomTransform |
Sets a new transform for the room, in world space. | VREditorMode.h | |
virtual bool ShouldDisplayExperimentalWarningOnEntry() |
VREditorMode.h | ||
void SnapSelectedActorsToGround() |
Snaps the current selected actor to the ground | VREditorMode.h | |
void StartExitingVRMode() |
Call this to start exiting VR mode | VREditorMode.h | |
void ToggleFlashlight
(
UVREditorInteractor* Interactor |
Spawns a flashlight on the specified hand | VREditorMode.h | |
bool UISystemIsActive() |
Check whether the UISystem exists | VREditorMode.h | |
void UpdateExternalSlateUI
(
TSharedRef< SWidget > InWidget, |
General way to spawn an external SlateUI from a radial menu | VREditorMode.h | |
void UpdateExternalUMGUI
(
const FVREditorFloatingUICreationContext& CreationContext |
General way to spawn an external UMG UI from a radial menu | VREditorMode.h |
Overridden from UVREditorModeBase
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual TSharedRef< FBaseSavedEditorState > CreateSavedState() |
Derived classes can override this to return a derived state struct, and add their own saved state. | VREditorMode.h | |
virtual void Enter() |
When the user actually enters the VR Editor mode | VREditorMode.h | |
virtual void Exit
(
bool bShouldDisableStereo |
When the user leaves the VR Editor mode | VREditorMode.h | |
virtual FTransform GetHeadTransform() |
Gets the world space transform of the HMD (head) | VREditorMode.h | |
virtual bool GetLaserForHand
(
EControllerHand InHand, |
Gives start and end points in world space for an active laser, or returns false if there is no active laser for the specified hand. | VREditorMode.h | |
virtual FTransform GetRoomTransform () |
Gets the world space transform of the calibrated VR room origin. | VREditorMode.h | |
virtual void Init() |
Initialize the VREditor | VREditorMode.h | |
virtual void Shutdown() |
Shutdown the VREditor | VREditorMode.h | |
virtual bool WantsToExitMode() |
Returns true if the user wants to exit this mode | VREditorMode.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void BeginEntry() |
Startup/Shutdown | VREditorMode.h | |
void FinishEntry() |
VREditorMode.h | ||
void SetupSubsystems() |
VREditorMode.h | ||
virtual void TransitionWorld
(
UWorld* NewWorld, |
VREditorMode.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static bool IsDebugModeEnabled() |
Returns if the VR Mode is in debug mode. | VREditorMode.h | |
static UVREditorAssetContainer & LoadAssetContainer() |
Loads and returns the container for all the assets of VREditor. | VREditorMode.h | |
static T OvershootEaseOut
(
T Alpha, |
VREditorMode.h | ||
static void ToggleDebugMode() |
Toggles the debug mode. | VREditorMode.h |