fix z bottom visualization when stock disabled
This commit is contained in:
parent
c67d641e43
commit
f31120dfb6
1 changed files with 25 additions and 24 deletions
|
|
@ -1383,9 +1383,6 @@ function updateStock(args, event) {
|
|||
let csx = proc.camStockX;
|
||||
let csy = proc.camStockY;
|
||||
let csz = proc.camStockZ;
|
||||
if (compute) {
|
||||
UI.func.animate.classList.remove('disabled');
|
||||
if (offset) {
|
||||
let min = { x: Infinity, y: Infinity, z: 0 };
|
||||
let max = { x: -Infinity, y: -Infinity, z: -Infinity };
|
||||
widgets.forEach(function(widget) {
|
||||
|
|
@ -1402,12 +1399,15 @@ function updateStock(args, event) {
|
|||
z: Math.max(max.z, wbnd.max.z)
|
||||
};
|
||||
});
|
||||
if (offset) {
|
||||
csx += max.x - min.x;
|
||||
csy += max.y - min.y;
|
||||
csz += max.z - min.z;
|
||||
csox = min.x + ((max.x - min.x) / 2);
|
||||
csoy = min.y + ((max.y - min.y) / 2);
|
||||
}
|
||||
if (compute) {
|
||||
UI.func.animate.classList.remove('disabled');
|
||||
if (!camStock) {
|
||||
let geo = new THREE.BoxGeometry(1, 1, 1);
|
||||
let mat = new THREE.MeshBasicMaterial({
|
||||
|
|
@ -1460,8 +1460,9 @@ function updateStock(args, event) {
|
|||
});
|
||||
camZBottom = new THREE.Mesh(geo, mat);
|
||||
camZBottom.renderOrder = 1;
|
||||
camZBottom.position.x = csox;
|
||||
camZBottom.position.y = csoy;
|
||||
camZBottom.position.z = proc.camZBottom;
|
||||
camZBottom._max = max;
|
||||
SPACE.world.add(camZBottom);
|
||||
} else {
|
||||
camZBottom = undefined;
|
||||
|
|
|
|||
Loading…
Reference in a new issue