VI.NavigationMode

VI.NavigationMode

#Overview

name: VI.NavigationMode

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of VI.NavigationMode is to control the navigation mode in the Unreal Engine viewport, specifically for VR (Virtual Reality) interactions. This setting variable is used to determine the type of navigation or movement method employed within the virtual environment.

This setting variable is primarily utilized by the ViewportInteraction module and the VPUtilitiesEditor plugin. These components are part of Unreal Engine’s editor tools, particularly those related to viewport manipulation and virtual production utilities.

The value of this variable is set as a console variable, which means it can be changed at runtime through the console or programmatically. It is initialized with a default value of 0 in the ViewportWorldInteraction.cpp file.

VI.NavigationMode interacts with other variables related to viewport interaction, such as MaxFlightSpeed, DragScale, and inertia damping variables. These variables collectively control the movement and navigation experience in the viewport.

Developers should be aware that changing this variable can significantly affect the user experience in the viewport, especially in VR contexts. A value of 1 seems to activate a “flight mode,” as seen in the CVarSinkHandler function.

Best practices when using this variable include:

  1. Carefully considering the impact on user experience before changing its value.
  2. Ensuring that related variables (like MaxFlightSpeed) are appropriately set to complement the chosen navigation mode.
  3. Testing thoroughly in both VR and non-VR contexts to ensure smooth navigation across different scenarios.
  4. Documenting any custom navigation modes implemented using this variable for team reference.
  5. Being mindful of performance implications, especially in VR where smooth navigation is crucial for user comfort.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Editor/ViewportInteraction/Private/ViewportWorldInteraction.cpp:87

Scope (from outer to inner):

file
namespace    VI

Source code excerpt:

	static FAutoConsoleVariable SFXMultiplier(TEXT("VI.SFXMultiplier"), 1.5f, TEXT("Default Sound Effect Volume Multiplier"));

	static FAutoConsoleVariable NavigationMode(TEXT("VI.NavigationMode"), 0, TEXT("VR NavigationMode"));
	static FAutoConsoleVariable MaxFlightSpeed(TEXT("VI.MaxFlightSpeed"), 11.0f, TEXT("Maximum Superman speed"));
	static FAutoConsoleVariable DragScale(TEXT("VI.DragScale"), 1.0f, TEXT("Scales the translation when dragging yourself through the world"));
	static FAutoConsoleVariable LowSpeedInertiaDamping(TEXT("VI.LowSpeedInertiaDamping"), 0.94f, TEXT("Low Speed Inertia Damping multiplier"));
	static FAutoConsoleVariable HighSpeedInertiaDamping(TEXT("VI.HighSpeedInertiaDamping"), 0.99f, TEXT("Hight Speed Inertia Damping multiplier"));

}

#Loc: <Workspace>/Engine/Plugins/Experimental/VirtualProductionUtilities/Source/VPUtilitiesEditor/Private/VPUIBase.cpp:34

Scope (from outer to inner):

file
function     bool UVPUIBase::Initialize

Source code excerpt:

		USelection::SelectionChangedEvent.AddUObject(this, &UVPUIBase::OnEditorSelectionChanged);
		USelection::SelectObjectEvent.AddUObject(this, &UVPUIBase::OnEditorSelectionChanged);
		// Monitor VI.NavigationMode cvar
		IConsoleManager::Get().RegisterConsoleVariableSink_Handle(FConsoleCommandDelegate::CreateUObject(this, &UVPUIBase::CVarSinkHandler));

		GetSelectedActor();
	}

	return SuperInitialized;

#Loc: <Workspace>/Engine/Plugins/Experimental/VirtualProductionUtilities/Source/VPUtilitiesEditor/Private/VPUIBase.cpp:143

Scope (from outer to inner):

file
function     void UVPUIBase::CVarSinkHandler

Source code excerpt:

void UVPUIBase::CVarSinkHandler()
{
	IConsoleVariable* CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("VI.NavigationMode"));
	if (CVar)
	{
		if (CVar->GetInt() == 1)
		{
			OnFlightModeChanged(true);
		}