Chaos AABBTree dirty grid, Raycasts and Sweeps are now done in local coordinates to improve precision in very large worlds

#rb Cedric.Caillaud
[FYI] Benn.Gallagher, Chris.Caulfield
#jira none

[at]Cedric.Caillaud
#preflight 60f800be391d4600017da922

#ROBOMERGE-SOURCE: CL 16908144 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v836-16769935)

[CL 16908151 by jaco vandyk in ue5-release-engine-test branch]
This commit is contained in:
jaco vandyk
2021-07-21 07:52:44 -04:00
parent cc848ed446
commit 5f0027fd60
2 changed files with 63 additions and 48 deletions

View File

@@ -615,14 +615,15 @@ namespace ChaosTest
{
FAABBTreeDirtyGridCVars::DirtyElementMaxCellCapacity = 7;
TUniquePtr<TBox<FReal, 3>> Box;
auto Boxes = BuildBoxes(Box, 100, FVec3(40, 40, 1), FVec3(-2000, -2000, -50));
FVec3 LargeOffset(10000000, 10000000, 10000000); // Test for floating point precision errors at large world offsets
auto Boxes = BuildBoxes(Box, 100, FVec3(40, 40, 1), FVec3(-2000, -2000, -50) + LargeOffset);
for (float Angle = 0.0; Angle < 2 * PI; Angle += (10.0f / 360.0f) * 2.0f * PI)
{
FVec3 Direction{ FMath::Cos(Angle), FMath::Sin(Angle), 0 };
// With the grid
FVisitor VisitorGrid(FVec3(53, 27, 0), Direction, 0, *Boxes);
FVisitor VisitorGrid(FVec3(53, 27, 0) + LargeOffset, Direction, 0, *Boxes);
VisitorGrid.HalfExtents = FVec3(102, 20, 2);
{
FAABBTreeDirtyGridCVars::DirtyElementGridCellSize = 100;
@@ -641,7 +642,7 @@ namespace ChaosTest
}
// Without the grid
FVisitor VisitorNoGrid(FVec3(53, 27, 0), Direction, 0, *Boxes);
FVisitor VisitorNoGrid(FVec3(53, 27, 0) + LargeOffset, Direction, 0, *Boxes);
VisitorNoGrid.HalfExtents = FVec3(102, 20, 2);
{
FAABBTreeDirtyGridCVars::DirtyElementGridCellSize = 0;