// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
#pragma once
#include "Engine/Core/Math/Vector2.h"
#include "Engine/Core/Math/Vector3.h"
///
/// Collection of various noise functions (eg. Perlin, Worley, Voronoi).
///
API_CLASS(Static, Namespace="FlaxEngine.Utilities") class FLAXENGINE_API Noise
{
DECLARE_SCRIPTING_TYPE_MINIMAL(Noise);
public:
///
/// Classic Perlin noise.
///
/// Point on a 2D grid to sample noise at.
/// Noise value (range 0-1).
API_FUNCTION() static float PerlinNoise(const Float2& p);
///
/// Classic Perlin noise with periodic variant (tiling).
///
/// Point on a 2D grid to sample noise at.
/// Periodic variant of the noise - period of the noise.
/// Noise value (range 0-1).
API_FUNCTION() static float PerlinNoise(const Float2& p, const Float2& rep);
///
/// Simplex noise.
///
/// Point on a 2D grid to sample noise at.
/// Noise value (range 0-1).
API_FUNCTION() static float SimplexNoise(const Float2& p);
///
/// Worley noise (cellar noise with standard 3x3 search window for F1 and F2 values).
///
/// Point on a 2D grid to sample noise at.
/// Noise value with: F1 and F2 feature points.
API_FUNCTION() static Float2 WorleyNoise(const Float2& p);
///
/// Voronoi noise (X=minDistToCell, Y=randomColor, Z=minEdgeDistance).
///
/// Point on a 2D grid to sample noise at.
/// Noise result with: X=minDistToCell, Y=randomColor, Z=minEdgeDistance.
API_FUNCTION() static Float3 VoronoiNoise(const Float2& p);
///
/// Custom noise function (3D -> 1D).
///
/// Point on a 3D grid to sample noise at.
/// Noise result.
API_FUNCTION() static float CustomNoise(const Float3& p);
///
/// Custom noise function (3D -> 3D).
///
/// Point on a 3D grid to sample noise at.
/// Noise result.
API_FUNCTION() static Float3 CustomNoise3D(const Float3& p);
///
/// Custom noise function for forces.
///
/// Point on a 3D grid to sample noise at.
/// Noise octaves count.
/// Noise roughness (in range 0-1).
/// Noise result.
API_FUNCTION() static Float3 CustomNoise3D(const Float3& p, int32 octaves, float roughness);
};