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

◆ grad3d()

fl::i32 fl::perlin_s16x16::grad3d ( int hash,
fl::i32 x,
fl::i32 y,
fl::i32 z )
static

Definition at line 140 of file perlin_s16x16.cpp.hpp.

140 {
141 // Matches float grad(hash, x, y, z) from perlin_float.h:
142 // h = hash & 15
143 // u = h < 8 ? x : y
144 // v = h < 4 ? y : (h == 12 || h == 14 ? x : z)
145 // return ((h&1)==0 ? u : -u) + ((h&2)==0 ? v : -v)
146 int h = hash & 15;
147 fl::i32 u = h < 8 ? x : y;
148 fl::i32 v = h < 4 ? y : (h == 12 || h == 14 ? x : z);
149 return ((h & 1) == 0 ? u : -u) + ((h & 2) == 0 ? v : -v);
150}
uint32_t z[NUM_LAYERS]
Definition Fire2023.h:93

References fl::x, fl::y, and z.

Referenced by pnoise3d_raw().

+ Here is the caller graph for this function: