MCPcopy Create free account
hub / github.com/esengine/esengine / noiseHash

Function noiseHash

packages/particle/src/modules/NoiseModule.ts:11–15  ·  view source on GitHub ↗
(x: number, y: number)

Source from the content-addressed store, hash-verified

9 * Uses classic integer hash algorithm to generate pseudo-random values
10 */
11export function noiseHash(x: number, y: number): number {
12 const n = x + y * 57;
13 const shifted = (n << 13) ^ n;
14 return ((shifted * (shifted * shifted * 15731 + 789221) + 1376312589) & 0x7fffffff) / 0x7fffffff;
15}
16
17/**
18 * 2D 值噪声函数

Callers 1

valueNoise2DFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected