allow meta + click to focus camera for better navigation

This commit is contained in:
Stewart Allen 2022-01-03 00:43:35 -05:00
commit 466c389b89
2 changed files with 8 additions and 4 deletions

View file

@ -225,9 +225,9 @@ let api = mesh.api = {
}
},
// @param object {THREE.Object3D | THREE.Object3D[]}
// @param object {THREE.Object3D | THREE.Object3D[] | Point}
focus(object) {
let { center } = util.bounds(object);
let { center } = object.center ? object : util.bounds(object);
// when no valid objects supplied, set origin
if (isNaN(center.x * center.y * center.z)) {
center = { x: 0, y: 0, z: 0 };