From 3d05c9ae8446a9e579617e6f5d5d5f48e095eb8f Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 28 May 2022 18:46:27 +0200 Subject: [PATCH] rogueviz::heatx:: added heat mode as parameter, and added '3' for fake Euclidean heat --- rogueviz/heatx.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/rogueviz/heatx.cpp b/rogueviz/heatx.cpp index 902c7682..cb89203b 100644 --- a/rogueviz/heatx.cpp +++ b/rogueviz/heatx.cpp @@ -40,7 +40,7 @@ void advance_heat_wave() { int steps = mode == 2 ? (frac * qsteps) : (frac * frac * qsteps); - if(steps != last_steps) { + if(steps != last_steps || mode == 3) { celllister cl(cwt.at, 999999, simulation_range, nullptr); if(steps < last_steps) { last_steps = 0; @@ -92,6 +92,15 @@ void advance_heat_wave() { } last_steps++; } + + if(mode == 3) { + ld fsteps = qsteps * frac; + for(cell *c: cl.lst) { + ld d = hdist0(tC0(ggmatrix(c))); + m1[c] = m2[c] = m3[c] = exp(-d*d/(fsteps+1e-3)); + } + } + ld maxv = 0; for(auto p: m1) maxv = max(maxv, abs(p.second)); for(cell *c: cl.lst) { @@ -184,6 +193,7 @@ auto heathook = arg::add3("-heatx", enable) ->editable(0, 1, 0.001, "scale", "scaling factor", 'f'); param_i(simulation_range, "heat_range") ->editable(0, 100000, 1000, "heat simulation range", "number of cells to consider", 'r'); + param_i(mode, "heat_mode"); }) + addHook_rvslides(180, [] (string s, vector& v) { if(s != "mixed") return;