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

◆ grad() [4/4]

static fl::i32 grad ( fl::u8 hash,
fl::i32 x,
fl::i32 y,
fl::i32 z,
fl::i32 t )
static

Definition at line 97 of file simplex.cpp.hpp.

97 {
98 fl::u8 h = hash & 31; // Convert low 5 bits of hash code into 32 simple
99 fl::i32 u = h < 24 ? x : y; // gradient directions, and compute dot product.
100 fl::i32 v = h < 16 ? y : z;
101 fl::i32 w = h < 8 ? z : t;
102 return ((h&1) != 0 ? -u : u) + ((h&2) != 0 ? -v : v) + ((h&4) != 0 ? -w : w);
103}
int y
Definition simple.h:93
int x
Definition simple.h:92
uint32_t z[NUM_LAYERS]
Definition Fire2023.h:93
static uint32_t t
Definition Luminova.h:55
unsigned char u8
Definition stdint.h:131

References t, x, y, and z.