Skip to content

Commit 2d6066c

Browse files
authored
Merge pull request #504 from Kitware/camera-style-light
fix(Manipulators): Update light orientation if needed
2 parents 132a58b + 11ac939 commit 2d6066c

File tree

5 files changed

+20
-0
lines changed

5 files changed

+20
-0
lines changed

Sources/Interaction/Manipulators/TrackballPan/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ function vtkTrackballPan(publicAPI, model) {
8585
}
8686

8787
renderer.resetCameraClippingRange();
88+
89+
if (interactor.getLightFollowCamera()) {
90+
renderer.updateLightsGeometryToFollowCamera();
91+
}
8892
};
8993
}
9094

Sources/Interaction/Manipulators/TrackballRoll/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ function vtkTrackballRoll(publicAPI, model) {
113113
camera.orthogonalizeViewUp();
114114

115115
renderer.resetCameraClippingRange();
116+
117+
if (interactor.getLightFollowCamera()) {
118+
renderer.updateLightsGeometryToFollowCamera();
119+
}
116120
};
117121
}
118122

Sources/Interaction/Manipulators/TrackballRotate/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ function vtkTrackballRotate(publicAPI, model) {
102102
camera.orthogonalizeViewUp();
103103

104104
renderer.resetCameraClippingRange();
105+
106+
if (interactor.getLightFollowCamera()) {
107+
renderer.updateLightsGeometryToFollowCamera();
108+
}
105109
};
106110
}
107111

Sources/Interaction/Manipulators/TrackballZoom/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ function vtkTrackballZoom(publicAPI, model) {
7575
camera.setPosition(cameraPos[0], cameraPos[1], cameraPos[2]);
7676
renderer.resetCameraClippingRange();
7777
}
78+
79+
if (interactor.getLightFollowCamera()) {
80+
renderer.updateLightsGeometryToFollowCamera();
81+
}
7882
};
7983

8084
publicAPI.onPinch = (interactor) => {

Sources/Interaction/Manipulators/TrackballZoomToMouse/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ function vtkTrackballZoomToMouse(publicAPI, model) {
3636
renderer,
3737
interactor
3838
);
39+
40+
if (interactor.getLightFollowCamera()) {
41+
renderer.updateLightsGeometryToFollowCamera();
42+
}
3943
};
4044
}
4145

0 commit comments

Comments
 (0)