| 255 | } |
| 256 | |
| 257 | void FlowFieldFloat::emitOrbitalDots(float t) { |
| 258 | int w = (int)getWidth(); |
| 259 | int h = (int)getHeight(); |
| 260 | int minDim = fl::min(w, h); |
| 261 | int n = mParams.dot_count; |
| 262 | float fn = (float)n; |
| 263 | float ocx = w * 0.5f - 0.5f; |
| 264 | float ocy = h * 0.5f - 0.5f; |
| 265 | float orad = minDim * 0.35f; |
| 266 | float base = t * 3.0f; |
| 267 | float dotDiam = 1.5f; |
| 268 | for (int i = 0; i < n; i++) { |
| 269 | float a = base + i * (2.0f * FL_PI / fn); |
| 270 | float cx = ocx + cosf(a) * orad; |
| 271 | float cy = ocy + sinf(a) * orad; |
| 272 | CRGB c = rainbow(t, mParams.color_shift, (float)i / fn); |
| 273 | drawDot(cx, cy, dotDiam, c.r, c.g, c.b); |
| 274 | } |
| 275 | } |
| 276 | |
| 277 | void FlowFieldFloat::flowPrepare(float t) { |
| 278 | int w = (int)getWidth(); |