Created
March 24, 2021 12:32
-
-
Save vorixo/3743e3c095315f334e28047bb5960d25 to your computer and use it in GitHub Desktop.
Ensures that your physics settings are appropiate for your precision target.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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); | |
} | |
} | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment