FastLED 3.10.8
Loading...
Searching...
No Matches

◆ grad()

FASTLED_FORCE_INLINE float fl::grad ( int hash,
float x,
float y,
float z )

Definition at line 56 of file perlin_float.h.

56 {
57 int h = hash & 15; /* CONVERT LO 4 BITS OF HASH CODE */
58 float u = h < 8 ? x : y, /* INTO 12 GRADIENT DIRECTIONS. */
59 v = h < 4 ? y
60 : h == 12 || h == 14 ? x
61 : z;
62 return ((h & 1) == 0 ? u : -u) + ((h & 2) == 0 ? v : -v);
63}
uint32_t z[NUM_LAYERS]
Definition Fire2023.h:93

References FASTLED_FORCE_INLINE, FL_NO_EXCEPT, x, y, and z.

Referenced by fl::anonymous_namespace{wave.cpp.hpp}::BatchDraw::BatchDraw(), fl::FlowFieldFloat::Perlin2D::noise(), pnoise(), fl::perlin_q16::pnoise2d_raw(), fl::perlin_s16x16::pnoise2d_raw(), and fl::perlin_s8x8::pnoise2d_raw().

+ Here is the caller graph for this function: