Explicit upward angle solution

2.0.x
Scott Lahteine 8 years ago
parent ecdf68735f
commit de5e485ed7

@ -1522,10 +1522,8 @@
if (isnan(ubl.z_values[x][y]) && !isnan(ubl.z_values[x1][y1]) && !isnan(ubl.z_values[x2][y2])) { if (isnan(ubl.z_values[x][y]) && !isnan(ubl.z_values[x1][y1]) && !isnan(ubl.z_values[x2][y2])) {
if (ubl.z_values[x1][y1] < ubl.z_values[x2][y2]) // Angled downward? if (ubl.z_values[x1][y1] < ubl.z_values[x2][y2]) // Angled downward?
ubl.z_values[x][y] = ubl.z_values[x1][y1]; // Use nearest (maybe a little too high.) ubl.z_values[x][y] = ubl.z_values[x1][y1]; // Use nearest (maybe a little too high.)
else { else
const float diff = ubl.z_values[x1][y1] - ubl.z_values[x2][y2]; // Angled upward ubl.z_values[x][y] = 2.0 * ubl.z_values[x1][y1] - ubl.z_values[x2][y2]; // Angled upward...
ubl.z_values[x][y] = ubl.z_values[x1][y1] + diff; // Use closest plus difference
}
return true; return true;
} }
return false; return false;

Loading…
Cancel
Save