EBGeometry 1.0
|
Ken Perlins gradient noise function. More...
#include <EBGeometry_AnalyticDistanceFunctions.hpp>
Public Member Functions | |
PerlinSDF (const T a_noiseAmplitude, const Vec3T< T > a_noiseFrequency, const T a_noisePersistence, const unsigned int a_noiseOctaves) noexcept | |
Full constructor. | |
virtual | ~PerlinSDF () noexcept |
Destructor (does nothing) | |
virtual T | signedDistance (const Vec3T< T > &a_point) const noexcept override |
Signed distance function. Generates a distance on [0,curAmplitude]. | |
template<class URNG > | |
void | shuffle (URNG &g) noexcept |
Shuffle the permutation with the input RNG. | |
std::array< int, 512 > & | getPermutationTable () noexcept |
Get the internal permutation table. | |
![]() | |
SignedDistanceFunction ()=default | |
Disallowed, use the full constructor. | |
virtual | ~SignedDistanceFunction ()=default |
Destructor (does nothing) | |
virtual T | value (const Vec3T< T > &a_point) const noexcept override final |
Implementation of ImplicitFunction::value. | |
virtual Vec3T< T > | normal (const Vec3T< T > &a_point, const T &a_delta) const noexcept |
Signed distance normal vector. | |
![]() | |
ImplicitFunction ()=default | |
Disallowed, use the full constructor. | |
virtual | ~ImplicitFunction ()=default |
Destructor (does nothing) | |
T | operator() (const Vec3T< T > &a_point) const noexcept |
Alternative signature for the value function. | |
template<class BV > | |
BV | approximateBoundingVolumeOctree (const Vec3T< T > &a_initialLowCorner, const Vec3T< T > &a_initialHighCorner, const unsigned int a_maxTreeDepth, const T &a_safety=0.0) const noexcept |
Compute an approximation to the bounding volume for the implicit surface, using octrees. | |
Protected Member Functions | |
virtual T | lerp (const T t, const T a, const T b) const noexcept |
Ken Perlin's lerp function. | |
virtual T | fade (const T t) const noexcept |
Ken Perlin's fade function. | |
T | grad (const int hash, const T x, const T y, const T z) const noexcept |
Ken Perlins grad function. | |
T | noise (const Vec3T< T > &a_point) const noexcept |
Octave noise function. | |
Protected Attributes | |
Vec3T< T > | m_noiseFrequency |
Noise frequency. | |
T | m_noiseAmplitude |
Noise amplitude. | |
T | m_noisePersistence |
Noise persistence. | |
std::array< T, 512 > | m_permutationTable |
Permutation table. | |
unsigned int | m_noiseOctaves |
Number of noise octaves. | |
|
inlinenoexcept |
Full constructor.
[in] | a_noiseAmplitude | Noise amplitude |
[in] | a_noiseFrequency | Spatial noise frequency along the three Cartesian axes |
[in] | a_noisePersistence | Noise amplitude drop-off and frequency increase for octave noise. Should be < 1 |
[in] | a_noiseOctaves | Number of octaves. Should be > 0 |
Ken Perlin's fade function.
[in] | t | Input parameter |
Get the internal permutation table.
|
inlineprotectednoexcept |
Ken Perlins grad function.
[in] | hash | Input parameter |
[in] | x | Input parameter |
[in] | y | Input parameter |
[in] | z | Input parameter |
|
inlineprotectedvirtualnoexcept |
Ken Perlin's lerp function.
[in] | t | Input parameter |
[in] | a | Input parameter |
[in] | b | Input parameter |
Octave noise function.
[in] | a_point | Input point |
Shuffle the permutation with the input RNG.
URNG should be a uniform random number generator, e.g.
[in] | g | Uniform random number generator (e.g., std::mt19937) |
|
inlineoverridevirtualnoexcept |
Signed distance function. Generates a distance on [0,curAmplitude].
[in] | a_point | Input point |
Implements SignedDistanceFunction< T >.