fix multi-widget bounding box accuracy
This commit is contained in:
parent
560ca3d53e
commit
e8ba6aa492
1 changed files with 6 additions and 1 deletions
|
|
@ -49,8 +49,13 @@ function update_info() {
|
||||||
const ui = api.ui;
|
const ui = api.ui;
|
||||||
let bounds = new THREE.Box3(), track;
|
let bounds = new THREE.Box3(), track;
|
||||||
for_meshes(mesh => {
|
for_meshes(mesh => {
|
||||||
bounds = bounds.union(mesh.getBoundingBox());
|
let box = mesh.getBoundingBox().clone();
|
||||||
track = mesh.widget.track;
|
track = mesh.widget.track;
|
||||||
|
let {pos} = track
|
||||||
|
box.min.add(pos);
|
||||||
|
box.max.add(pos);
|
||||||
|
console.log(structuredClone({pos}))
|
||||||
|
bounds = bounds.union(box);
|
||||||
});
|
});
|
||||||
if (bounds.min.x === Infinity) {
|
if (bounds.min.x === Infinity) {
|
||||||
if (selectedMeshes.length === 0) {
|
if (selectedMeshes.length === 0) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue