p.Chaos.UseRBANForDefaultPhysicsAssetSolverType

p.Chaos.UseRBANForDefaultPhysicsAssetSolverType

#Overview

name: p.Chaos.UseRBANForDefaultPhysicsAssetSolverType

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 p.Chaos.UseRBANForDefaultPhysicsAssetSolverType is to control the default solver type for physics assets in Unreal Engine’s Chaos physics system. This setting variable is related to the physics simulation subsystem, specifically for physics assets.

This setting variable is used in the PhysicsEngine module of Unreal Engine, as evidenced by its location in the PhysicsAsset.cpp file within the Engine/Source/Runtime/Engine/Private/PhysicsEngine/ directory.

The value of this variable is set using an FAutoConsoleVariableRef, which creates a console variable that can be modified at runtime. By default, it is set to false.

The associated variable bUseRBANForDefaultPhysicsAssetSolverType directly interacts with this setting. They share the same value and are used together to determine the solver type for physics assets.

Developers must be aware that changing this variable will affect the default solver type for all physics assets in the project. When set to true, it will use the RBAN (Reduced Body Animation Network) solver instead of the default World solver.

Best practices when using this variable include:

  1. Consider the performance implications of changing the solver type.
  2. Test thoroughly after modifying this setting, as it can significantly impact physics behavior.
  3. Use this setting consistently across the project to avoid unexpected behavior.

Regarding the associated variable bUseRBANForDefaultPhysicsAssetSolverType:

The purpose of bUseRBANForDefaultPhysicsAssetSolverType is to store the boolean value that determines whether to use the RBAN solver as the default for physics assets.

This variable is used in the UPhysicsAsset constructor to set the SolverType property. When true, it sets the solver type to RBAN; otherwise, it uses the World solver.

The value of this variable is set by the console variable p.Chaos.UseRBANForDefaultPhysicsAssetSolverType.

Developers should be aware that this variable directly affects the initialization of physics assets and should be used consistently throughout the project.

Best practices for using this variable include:

  1. Modifying it through the console variable rather than directly changing the code.
  2. Considering the implications on existing physics assets when changing this value.
  3. Documenting any project-wide changes to this setting for team awareness.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/PhysicsAsset.cpp:26

Scope: file

Source code excerpt:


bool bUseRBANForDefaultPhysicsAssetSolverType = false;
FAutoConsoleVariableRef CVarUseRBANForDefaultPhysicsAssetSolverType(TEXT("p.Chaos.UseRBANForDefaultPhysicsAssetSolverType"), bUseRBANForDefaultPhysicsAssetSolverType, TEXT("Boolean to use RBAN for default physics asset solver type (false by default)"));

FPhysicsAssetSolverSettings::FPhysicsAssetSolverSettings()
	: PositionIterations(6)
	, VelocityIterations(1)
	, ProjectionIterations(1)
	, CullDistance(3.0f)

#Associated Variable and Callsites

This variable is associated with another variable named bUseRBANForDefaultPhysicsAssetSolverType. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/PhysicsAsset.cpp:25

Scope: file

Source code excerpt:

#define LOCTEXT_NAMESPACE "PhysicsAsset"

bool bUseRBANForDefaultPhysicsAssetSolverType = false;
FAutoConsoleVariableRef CVarUseRBANForDefaultPhysicsAssetSolverType(TEXT("p.Chaos.UseRBANForDefaultPhysicsAssetSolverType"), bUseRBANForDefaultPhysicsAssetSolverType, TEXT("Boolean to use RBAN for default physics asset solver type (false by default)"));

FPhysicsAssetSolverSettings::FPhysicsAssetSolverSettings()
	: PositionIterations(6)
	, VelocityIterations(1)
	, ProjectionIterations(1)
	, CullDistance(3.0f)

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/PhysicsEngine/PhysicsAsset.cpp:56

Scope (from outer to inner):

file
function     UPhysicsAsset::UPhysicsAsset

Source code excerpt:

	: Super(ObjectInitializer)
{
	if(bUseRBANForDefaultPhysicsAssetSolverType)
	{
		SolverType = EPhysicsAssetSolverType::RBAN;
	}
	else
	{
		SolverType = EPhysicsAssetSolverType::World;