Skip to content

Instantly share code, notes, and snippets.

View vorixo's full-sized avatar
🏠
Working from home

Alvaro Jover-Alvarez vorixo

🏠
Working from home
View GitHub Profile
@vorixo
vorixo / Substep Checker
Created March 24, 2021 12:32
Ensures that your physics settings are appropiate for your precision target.
#if WITH_EDITOR
const UPhysicsSettings* Settings = UPhysicsSettings::Get();
if (Settings && GetWorld()->GetTimeSeconds() > 5.f)
{
const float RequiredSteps = GetWorld()->GetDeltaSeconds() / Settings->MaxSubstepDeltaTime;
if (!ensure(RequiredSteps <= Settings->MaxSubsteps))
{
const FString SimulationMessage = FString::Printf(TEXT("The simulation requires more steps to be representative at the current Delta Time. Consider increasing MaxSubsteps if you desire MaxSubstepDeltaTime precision. Required Steps: %d"), FMath::CeilToInt(RequiredSteps));
PRINT_TICK(SimulationMessage);
}

Keybase proof

I hereby claim:

  • I am vorixo on github.
  • I am vorixo (https://keybase.io/vorixo) on keybase.
  • I have a public key ASCTBMm0yIgTo8NUN_5MBzOVX2VMIABF3V19omFU42hbqQo

To claim this, I am signing this object: