From 1e587316c0a3b5d66366f7279b09e53701b1a2ef Mon Sep 17 00:00:00 2001 From: Caerind Date: Tue, 6 May 2025 22:46:06 +0200 Subject: [PATCH] Add getters to FastNoiseLite Cpp --- Cpp/FastNoiseLite.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Cpp/FastNoiseLite.h b/Cpp/FastNoiseLite.h index c67f2e5c..6f4c4ad5 100644 --- a/Cpp/FastNoiseLite.h +++ b/Cpp/FastNoiseLite.h @@ -144,6 +144,7 @@ class FastNoiseLite /// Default: 1337 /// void SetSeed(int seed) { mSeed = seed; } + int GetSeed() const { return mSeed; } /// /// Sets frequency for all noise types @@ -152,6 +153,7 @@ class FastNoiseLite /// Default: 0.01 /// void SetFrequency(float frequency) { mFrequency = frequency; } + float GetFrequency() const { return mFrequency; } /// /// Sets noise algorithm used for GetNoise(...) @@ -164,6 +166,7 @@ class FastNoiseLite mNoiseType = noiseType; UpdateTransformType3D(); } + NoiseType GetNoiseType() const { return mNoiseType; } /// /// Sets domain rotation type for 3D Noise and 3D DomainWarp. @@ -178,6 +181,7 @@ class FastNoiseLite UpdateTransformType3D(); UpdateWarpTransformType3D(); } + RotationType3D GeRotationType3D() const { return mRotationType3D; } /// /// Sets method for combining octaves in all fractal noise types @@ -187,6 +191,7 @@ class FastNoiseLite /// Note: FractalType_DomainWarp... only affects DomainWarp(...) /// void SetFractalType(FractalType fractalType) { mFractalType = fractalType; } + FractalType GetFractalType() const { return mFractalType; } /// /// Sets octave count for all fractal noise types @@ -199,6 +204,7 @@ class FastNoiseLite mOctaves = octaves; CalculateFractalBounding(); } + int GetFractalOctaves() const { return mOctaves; } /// /// Sets octave lacunarity for all fractal noise types @@ -207,6 +213,7 @@ class FastNoiseLite /// Default: 2.0 /// void SetFractalLacunarity(float lacunarity) { mLacunarity = lacunarity; } + float GetFractalLacunarity() const { return mLacunarity; } /// /// Sets octave gain for all fractal noise types @@ -219,6 +226,7 @@ class FastNoiseLite mGain = gain; CalculateFractalBounding(); } + float GetFractalGain() const { return mGain; } /// /// Sets octave weighting for all none DomainWarp fratal types @@ -228,6 +236,7 @@ class FastNoiseLite /// Note: Keep between 0...1 to maintain -1...1 output bounding /// void SetFractalWeightedStrength(float weightedStrength) { mWeightedStrength = weightedStrength; } + float GetFractalWeightedStrength() const { return mWeightedStrength; } /// /// Sets strength of the fractal ping pong effect @@ -236,7 +245,7 @@ class FastNoiseLite /// Default: 2.0 /// void SetFractalPingPongStrength(float pingPongStrength) { mPingPongStrength = pingPongStrength; } - + float GetFractalPingPongStrength() const { return mPingPongStrength; } /// /// Sets distance function used in cellular noise calculations @@ -245,6 +254,7 @@ class FastNoiseLite /// Default: Distance /// void SetCellularDistanceFunction(CellularDistanceFunction cellularDistanceFunction) { mCellularDistanceFunction = cellularDistanceFunction; } + CellularDistanceFunction GetCellularDistanceFunction() const { return mCellularDistanceFunction; } /// /// Sets return type from cellular noise calculations @@ -253,6 +263,7 @@ class FastNoiseLite /// Default: EuclideanSq /// void SetCellularReturnType(CellularReturnType cellularReturnType) { mCellularReturnType = cellularReturnType; } + CellularReturnType GetCellularReturnType() const { return mCellularReturnType; } /// /// Sets the maximum distance a cellular point can move from it's grid position @@ -262,7 +273,7 @@ class FastNoiseLite /// Note: Setting this higher than 1 will cause artifacts /// void SetCellularJitter(float cellularJitter) { mCellularJitterModifier = cellularJitter; } - + float GetCellularJitter() const { return mCellularJitterModifier; } /// /// Sets the warp algorithm when using DomainWarp(...) @@ -275,7 +286,7 @@ class FastNoiseLite mDomainWarpType = domainWarpType; UpdateWarpTransformType3D(); } - + DomainWarpType GetDomainWarpType() const { return mDomainWarpType; } /// /// Sets the maximum warp distance from original position when using DomainWarp(...) @@ -284,7 +295,7 @@ class FastNoiseLite /// Default: 1.0 /// void SetDomainWarpAmp(float domainWarpAmp) { mDomainWarpAmp = domainWarpAmp; } - + float GetDomainWarpAmp() const { return mDomainWarpAmp; } /// /// 2D noise at given position using current settings