Commit 099bf912 authored by Andrey Filippov's avatar Andrey Filippov

improved MB (proportional, not 50/50)

parent b3ce3bd2
......@@ -4380,12 +4380,19 @@ public class GpuQuad{ // quad camera description
}
dx *= mb_offs;
dy *= mb_offs;
centerXY_sub = new double[] {centerXY[0]+0.5*dx,centerXY[1]+0.5*dy};
centerXY = new double[] {centerXY[0]-0.5*dx,centerXY[1]-0.5*dy};
tp_task_sub.setCenterXY(centerXY_sub);
double exp_offs = Math.exp(-mb_offs/mb_len);
// centroid offset from the first point along the {dx,dy}, in the range 0..1
// using that centroid of the half-exponent (-inf to 0) is at -1
double rel_cent = mb_len* (1.0 - (mb_offs/mb_len + 1.0) * exp_offs) / (mb_offs * (1 - exp_offs));
centerXY = new double[] {centerXY[0]-rel_cent* dx, centerXY[1]-rel_cent* dy};
centerXY_sub = new double[] {centerXY[0]+(1-rel_cent)*dx, centerXY[1]+(1-rel_cent)*dy};
tp_task.setCenterXY(centerXY);
tp_task_sub.setCenterXY(centerXY_sub);
double gain = 1.0/(1.0 - exp_offs);
double gain_sub = -gain * exp_offs;
if (gain_sub > -min_sub) {
gain_sub = -min_sub;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment