FastLED 3.9.15
Loading...
Searching...
No Matches

◆ grad()

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

Definition at line 55 of file perlin_float.h.

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

References FASTLED_FORCE_INLINE, x, y, and z.

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

+ Here is the caller graph for this function: