fix progressive shadows in rough/outline by using terrain top/bottom derived from new fit option
This commit is contained in:
parent
b19f985728
commit
41d95c5585
3 changed files with 29 additions and 15 deletions
|
|
@ -253,25 +253,35 @@
|
|||
interval(step, options) {
|
||||
let opt = options || {},
|
||||
bounds = this.bounds,
|
||||
boff = opt.boff || 0, // bottom offset
|
||||
toff = opt.toff || 0, // top offset
|
||||
boff = opt.boff || opt.off || 0, // bottom offset
|
||||
toff = opt.toff || opt.off || 0, // top offset
|
||||
zmin = (opt.min || this.bounds.min.z) + boff,
|
||||
zmax = (opt.max || this.bounds.max.z) - toff,
|
||||
count = Math.floor((zmax - zmin) / step),
|
||||
array = new Array(count);
|
||||
steps = (zmax - zmin) / step,
|
||||
count = Math.floor(steps),
|
||||
array = [];
|
||||
|
||||
if (opt.fit) {
|
||||
count++;
|
||||
step = (zmax - zmin) / count;
|
||||
}
|
||||
|
||||
if (opt.down) {
|
||||
for (let i=0, il=array.length; i<il; i++) {
|
||||
array[i] = zmax;
|
||||
for (let i=0; i<count; i++) {
|
||||
array.push(zmax);
|
||||
zmax -= step;
|
||||
}
|
||||
} else {
|
||||
for (let i=0, il=array.length; i<il; i++) {
|
||||
array[i] = zmin;
|
||||
for (let i=0; i<count; i++) {
|
||||
array.push(zmin);
|
||||
zmin += step;
|
||||
}
|
||||
}
|
||||
|
||||
if (opt.fit) {
|
||||
array.push(opt.down ? zmax : zmin);
|
||||
}
|
||||
|
||||
return array;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue