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

◆ grad16() [3/3]

static int16_t grad16 ( uint8_t hash,
int16_t x,
int16_t y,
int16_t z )
inlinestatic

Definition at line 111 of file noise.cpp.

111 {
112#if 0
113 switch(hash & 0xF) {
114 case 0: return (( x) + ( y))>>1;
115 case 1: return ((-x) + ( y))>>1;
116 case 2: return (( x) + (-y))>>1;
117 case 3: return ((-x) + (-y))>>1;
118 case 4: return (( x) + ( z))>>1;
119 case 5: return ((-x) + ( z))>>1;
120 case 6: return (( x) + (-z))>>1;
121 case 7: return ((-x) + (-z))>>1;
122 case 8: return (( y) + ( z))>>1;
123 case 9: return ((-y) + ( z))>>1;
124 case 10: return (( y) + (-z))>>1;
125 case 11: return ((-y) + (-z))>>1;
126 case 12: return (( y) + ( x))>>1;
127 case 13: return ((-y) + ( z))>>1;
128 case 14: return (( y) + (-x))>>1;
129 case 15: return ((-y) + (-z))>>1;
130 }
131#else
132 hash = hash&15;
133 int16_t u = hash<8?x:y;
134 int16_t v = hash<4?y:hash==12||hash==14?x:z;
135 if(hash&1) { u = -u; }
136 if(hash&2) { v = -v; }
137
138 return AVG15(u,v);
139#endif
140}
int y
Definition simple.h:93
int x
Definition simple.h:92
uint32_t z[NUM_LAYERS]
Definition Fire2023.h:94

References x, y, and z.

Referenced by inoise16_raw(), inoise16_raw(), inoise16_raw(), and inoise16_raw().

+ Here is the caller graph for this function: