Skip to content

Commit 9d60f40

Browse files
authored
Merge pull request #134 from staminajim/seed-computation-fix
Use Unreal's PCG seed functions instead of using Perlin Noise
2 parents b8b318e + 4dba668 commit 9d60f40

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Source/PCGExtendedToolkit/Private/PCGExRandom.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "PCGComponent.h"
77
#include "PCGExMath.h"
88
#include "PCGSettings.h"
9+
#include "Helpers/PCGHelpers.h"
910

1011
namespace PCGExRandom
1112
{
@@ -60,9 +61,8 @@ namespace PCGExRandom
6061
}
6162

6263
int ComputeSpatialSeed(const FVector& Origin, const FVector& Offset)
63-
{
64-
return static_cast<int>(PCGExMath::Remap(
65-
FMath::PerlinNoise3D(PCGExMath::Tile(Origin * 0.001 + Offset, FVector(-1), FVector(1))),
66-
-1, 1, MIN_int32, MAX_int32));
64+
{
65+
return PCGHelpers::ComputeSeed(PCGHelpers::ComputeSeedFromPosition(Origin),
66+
PCGHelpers::ComputeSeedFromPosition(Offset));
6767
}
6868
}

0 commit comments

Comments
 (0)