20 #ifndef OPENVDB_AX_MATH_OPEN_SIMPLEX_NOISE_HAS_BEEN_INCLUDED 21 #define OPENVDB_AX_MATH_OPEN_SIMPLEX_NOISE_HAS_BEEN_INCLUDED 23 #include <openvdb/version.h> 33 template <
typename NoiseT>
34 void curlnoise(
double (*out)[3],
const double (*in)[3])
36 float delta = 0.0001f;
41 {
static_cast<float>((*in)[0]) + 000.0f, static_cast<float>((*in)[1]) + 000.0f, static_cast<float>((*in)[2]) + 000.0f },
42 {
static_cast<float>((*in)[0]) + 256.0f, static_cast<float>((*in)[1]) - 256.0f, static_cast<float>((*in)[2]) + 256.0f },
43 {
static_cast<float>((*in)[0]) - 512.0f, static_cast<float>((*in)[1]) + 512.0f, static_cast<float>((*in)[2]) - 512.0f },
48 a = (NoiseT::noise(p[2][0], p[2][1] + delta, p[2][2]) - NoiseT::noise(p[2][0], p[2][1] - delta, p[2][2])) / (2.0f * delta);
49 b = (NoiseT::noise(p[1][0], p[1][1], p[1][2] + delta) - NoiseT::noise(p[1][0], p[1][1], p[1][2] - delta)) / (2.0f * delta);
53 a = (NoiseT::noise(p[0][0], p[0][1], p[0][2] + delta) - NoiseT::noise(p[0][0], p[0][1], p[0][2] - delta)) / (2.0f * delta);
54 b = (NoiseT::noise(p[2][0] + delta, p[2][1], p[2][2]) - NoiseT::noise(p[2][0] - delta, p[2][1], p[2][2])) / (2.0f * delta);
58 a = (NoiseT::noise(p[1][0] + delta, p[1][1], p[1][2]) - NoiseT::noise(p[1][0] - delta, p[1][1], p[1][2])) / (2.0f * delta);
59 b = (NoiseT::noise(p[0][0], p[0][1] + delta, p[0][2]) - NoiseT::noise(p[0][0], p[0][1] - delta, p[0][2])) / (2.0f * delta);
64 template <
typename NoiseT>
65 void curlnoise(
double (*out)[3],
double x,
double y,
double z)
67 const double in[3] = {x, y, z};
68 curlnoise<NoiseT>(out, &in);
117 template <
typename T>
118 T eval(
const T x,
const T y,
const T z)
const;
122 template <
typename T>
123 inline T extrapolate(
const inttype xsb,
130 template <
typename T>
131 inline T extrapolate(
const inttype xsb,
141 static const int sGradients [72];
145 int mPermGradIndex [256];
150 #endif // OPENVDB_AX_MATH_OPEN_SIMPLEX_NOISE_HAS_BEEN_INCLUDED
Definition: OpenSimplexNoise.h:104
Definition: OpenSimplexNoise.h:76
void curlnoise(double(*out)[3], double x, double y, double z)
Definition: OpenSimplexNoise.h:65
Definition: Exceptions.h:13
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h.in:121
int64_t inttype
Definition: OpenSimplexNoise.h:107
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h.in:218