allow meta + click to focus camera for better navigation
This commit is contained in:
parent
ad271263e1
commit
466c389b89
2 changed files with 8 additions and 4 deletions
|
|
@ -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 };
|
||||
|
|
|
|||
Loading…
Reference in a new issue