r.Water.BuoyancyDebugSize
r.Water.BuoyancyDebugSize
#Overview
name: r.Water.BuoyancyDebugSize
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Side length of square for buoyancy debug.
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Water.BuoyancyDebugSize is to set the side length of a square used for buoyancy debugging in Unreal Engine’s water simulation system. This setting variable is primarily used for visualization and debugging purposes within the water and buoyancy simulation components.
This setting variable is mainly used in the Experimental Water plugin, specifically in the Buoyancy Component of the Water module. The Unreal Engine subsystem that relies on this variable is the water simulation system, particularly for debugging buoyancy calculations.
The value of this variable is set as a console variable with a default value of 1000. It can be modified at runtime through console commands or programmatically.
The r.Water.BuoyancyDebugSize variable interacts closely with another variable called CVarWaterBuoyancyDebugPoints. Together, these variables define the size and resolution of the debug visualization for buoyancy calculations.
Developers should be aware that this variable is primarily used for debugging purposes and may impact performance when enabled. It should be used judiciously and disabled in production builds or when not actively debugging water buoyancy issues.
Best practices when using this variable include:
- Use it in conjunction with CVarWaterBuoyancyDebugPoints for a complete debug visualization.
- Adjust the value as needed to get an appropriate visualization size for your specific water body and buoyancy setup.
- Remember to disable or remove debug visualizations in production builds to avoid unnecessary performance overhead.
Regarding the associated variable CVarWaterBuoyancyDebugSize:
The purpose of CVarWaterBuoyancyDebugSize is identical to r.Water.BuoyancyDebugSize, as they share the same value and are used interchangeably in the code.
This variable is used in the same Unreal Engine subsystem (water simulation) and the Experimental Water plugin.
The value of CVarWaterBuoyancyDebugSize is set through the TAutoConsoleVariable declaration, with the same default value of 1000.
CVarWaterBuoyancyDebugSize interacts with CVarWaterBuoyancyDebugPoints in the same way as r.Water.BuoyancyDebugSize does.
Developers should be aware that modifying either r.Water.BuoyancyDebugSize or CVarWaterBuoyancyDebugSize will affect the debug visualization in the same way.
Best practices for using CVarWaterBuoyancyDebugSize are the same as those for r.Water.BuoyancyDebugSize, as they are essentially the same variable with different access methods.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Experimental/Water/Source/Runtime/Private/BuoyancyComponent.cpp:27
Scope: file
Source code excerpt:
TAutoConsoleVariable<int32> CVarWaterBuoyancyDebugSize(
TEXT("r.Water.BuoyancyDebugSize"),
1000,
TEXT("Side length of square for buoyancy debug."),
ECVF_Default);
TAutoConsoleVariable<int32> CVarWaterUseSplineKeyOptimization(
TEXT("r.Water.UseSplineKeyOptimization"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarWaterBuoyancyDebugSize
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Experimental/Water/Source/Runtime/Private/BuoyancyComponent.cpp:26
Scope: file
Source code excerpt:
ECVF_Default);
TAutoConsoleVariable<int32> CVarWaterBuoyancyDebugSize(
TEXT("r.Water.BuoyancyDebugSize"),
1000,
TEXT("Side length of square for buoyancy debug."),
ECVF_Default);
TAutoConsoleVariable<int32> CVarWaterUseSplineKeyOptimization(
#Loc: <Workspace>/Engine/Plugins/Experimental/Water/Source/Runtime/Private/BuoyancyComponent.cpp:502
Scope (from outer to inner):
file
function int32 UBuoyancyComponent::UpdatePontoons
Source code excerpt:
{
const float NumPoints = CVarWaterBuoyancyDebugPoints.GetValueOnAnyThread();
const float Size = CVarWaterBuoyancyDebugSize.GetValueOnAnyThread();
const float StartOffset = NumPoints * 0.5f;
const float Scale = Size / NumPoints;
TMap<const UWaterBodyComponent*, float> DebugSplineKeyMap;
TMap<const UWaterBodyComponent*, float> DebugSplineSegmentsMap;
for (int i = 0; i < NumPoints; ++i)
{
#Loc: <Workspace>/Engine/Plugins/Experimental/Water/Source/Runtime/Public/BuoyancyComponentSimulation.h:435
Scope (from outer to inner):
file
class class FBuoyancyComponentSim
function static void UpdateBuoyancy
Source code excerpt:
{
const float NumPoints = CVarWaterBuoyancyDebugPoints.GetValueOnAnyThread();
const float Size = CVarWaterBuoyancyDebugSize.GetValueOnAnyThread();
const float StartOffset = NumPoints * 0.5f;
const float Scale = Size / NumPoints;
TMap<const FSolverSafeWaterBodyData*, float> DebugSplineKeyMap;
Chaos::FDebugDrawQueue::GetInstance().SetEnabled(true);
for (int i = 0; i < NumPoints; ++i)
{
#Loc: <Workspace>/Engine/Plugins/Experimental/Water/Source/Runtime/Public/BuoyancyTypes.h:11
Scope: file
Source code excerpt:
extern WATER_API TAutoConsoleVariable<int32> CVarWaterDebugBuoyancy;
extern WATER_API TAutoConsoleVariable<int32> CVarWaterBuoyancyDebugPoints;
extern WATER_API TAutoConsoleVariable<int32> CVarWaterBuoyancyDebugSize;
USTRUCT(Blueprintable)
struct FSphericalPontoon
{
GENERATED_BODY()