VI.HighSpeedInertiaDamping

VI.HighSpeedInertiaDamping

#Overview

name: VI.HighSpeedInertiaDamping

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

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of VI.HighSpeedInertiaDamping is to control the inertia damping multiplier for high-speed movements in the Unreal Engine’s viewport interaction system. This setting is primarily used for adjusting the feel and responsiveness of camera or object movement in virtual production and VR editing scenarios.

This setting variable is primarily utilized by the Viewport Interaction (VI) system and the Virtual Production Utilities plugin. Specifically, it’s referenced in the ViewportWorldInteraction module and the VPUtilitiesEditor module.

The value of this variable is typically set through the console or programmatically. It can be modified using the SetInertiaDampingCVar function in the VPScoutingSubsystem or through the settings modification in the VPUtilitiesEditorModule.

VI.HighSpeedInertiaDamping interacts with other variables related to viewport interaction, such as VI.LowSpeedInertiaDamping and VI.DragScale. These variables collectively contribute to the overall feel of movement and interaction in the viewport.

Developers should be aware that this variable directly affects the behavior of high-speed movements in the viewport. A higher value (closer to 1.0) will result in less damping and more inertia, while a lower value will increase damping and reduce inertia.

Best practices when using this variable include:

  1. Fine-tuning the value based on the specific needs of your project and the preferences of your team.
  2. Testing the setting with various movement speeds to ensure a smooth experience across different scenarios.
  3. Considering the interplay between this variable and other related settings (like LowSpeedInertiaDamping) to achieve the desired overall feel.
  4. Using the SetInertiaDampingCVar function or modifying it through the VPUtilitiesEditorModule when changing the value programmatically, rather than directly manipulating the console variable.
  5. Documenting any custom values used in your project to maintain consistency across different development environments.

#References in C++ code

#Callsites

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

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

Scope (from outer to inner):

file
namespace    VI

Source code excerpt:

	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"));

}

const TCHAR* UViewportWorldInteraction::AssetContainerPath = TEXT("/Engine/VREditor/ViewportInteractionAssetContainerData");

struct FGuideData

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

Scope (from outer to inner):

file
function     void UVPScoutingSubsystem::SetInertiaDampingCVar

Source code excerpt:

void UVPScoutingSubsystem::SetInertiaDampingCVar(const float InInertiaDamping)
{
	IConsoleVariable* CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("VI.HighSpeedInertiaDamping"));
	CVar->Set(InInertiaDamping);
}

bool UVPScoutingSubsystem::IsHelperSystemEnabled()
{
	return GetDefault<UVPUtilitiesEditorSettings>()->bIsHelperSystemEnabled;

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

Scope (from outer to inner):

file
function     bool FVPUtilitiesEditorModule::OnSettingsModified

Source code excerpt:

	GizmoCVar->Set(Settings->bUseTransformGizmo);

	IConsoleVariable* InertiaCVar = IConsoleManager::Get().FindConsoleVariable(TEXT("VI.HighSpeedInertiaDamping"));
	InertiaCVar->Set(Settings->bUseGripInertiaDamping ? Settings->InertiaDamping : 0);
	return true;
}


IMPLEMENT_MODULE(FVPUtilitiesEditorModule, VPUtilitiesEditor)

#Loc: <Workspace>/Engine/Plugins/Experimental/VirtualProductionUtilities/Source/VPUtilitiesEditor/Public/VPScoutingSubsystem.h:198

Scope (from outer to inner):

file
class        class UVPScoutingSubsystem : public UEditorSubsystem

Source code excerpt:

	static void SetIsUsingInertiaDamping(const bool bInIsUsingInertiaDamping);

	/** Set value of cvar "VI.HighSpeedInertiaDamping" */
	UFUNCTION(BlueprintCallable, Category = "Virtual Production")
	static void SetInertiaDampingCVar(const float InInertiaDamping);

	/** Whether the helper system on the controllers is enabled */
	UFUNCTION(BlueprintPure, Category = "Virtual Production")
	static bool IsHelperSystemEnabled();