@kitware/vtk.js 34.15.3 → 34.15.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import vtkOrientationMarkerWidget from '
|
|
3
|
-
import vtkAxesActor from '
|
|
4
|
-
import vtkInteractiveOrientationWidget from '
|
|
1
|
+
import { f as distance2BetweenPoints } from '../../../Common/Core/Math/index.js';
|
|
2
|
+
import vtkOrientationMarkerWidget from '../../../Interaction/Widgets/OrientationMarkerWidget.js';
|
|
3
|
+
import vtkAxesActor from '../../../Rendering/Core/AxesActor.js';
|
|
4
|
+
import vtkInteractiveOrientationWidget from '../InteractiveOrientationWidget.js';
|
|
5
5
|
|
|
6
6
|
function majorAxis(vec3, idxA, idxB) {
|
|
7
7
|
const axis = [0, 0, 0];
|
|
@@ -52,7 +52,7 @@ function alignCameraOnViewWidgetOrientationChange(viewWidget, camera, orientatio
|
|
|
52
52
|
const focalPoint = camera.getFocalPoint();
|
|
53
53
|
const position = camera.getPosition();
|
|
54
54
|
const viewUp = camera.getViewUp();
|
|
55
|
-
const distance = Math.sqrt(
|
|
55
|
+
const distance = Math.sqrt(distance2BetweenPoints(position, focalPoint));
|
|
56
56
|
camera.setPosition(focalPoint[0] + direction[0] * distance, focalPoint[1] + direction[1] * distance, focalPoint[2] + direction[2] * distance);
|
|
57
57
|
if (direction[0]) {
|
|
58
58
|
camera.setViewUp(majorAxis(viewUp, 1, 2));
|