Skip to content

Commit 3206a78

Browse files
committed
Fallback to old behavior for spin3d
1 parent f33188b commit 3206a78

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

packages/engine/Source/Scene/ScreenSpaceCameraController.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,10 +1125,7 @@ function pickPosition(controller, mousePosition, result) {
11251125
);
11261126
}
11271127

1128-
if (
1129-
!defined(globe) ||
1130-
(defined(depthIntersection) && !globe.translucency.enabled)
1131-
) {
1128+
if (!defined(globe)) {
11321129
return Cartesian3.clone(depthIntersection, result);
11331130
}
11341131

@@ -1874,6 +1871,7 @@ const scratchRadii = new Cartesian3();
18741871
const scratchEllipsoid = new Ellipsoid();
18751872
const scratchLookUp = new Cartesian3();
18761873
const scratchNormal = new Cartesian3();
1874+
const scratchMousePosition = new Cartesian3();
18771875

18781876
function spin3D(controller, startPosition, movement) {
18791877
const scene = controller._scene;
@@ -1925,13 +1923,10 @@ function spin3D(controller, startPosition, movement) {
19251923
const globe = controller._globe;
19261924

19271925
if (defined(globe) && height < controller._minimumPickingTerrainHeight) {
1928-
const ray = camera.getPickRay(startPosition, pickGlobeScratchRay);
1929-
const cullBackFaces = !controller._cameraUnderground;
1930-
const mousePos = globe.pickWorldCoordinates(
1931-
ray,
1932-
scene,
1933-
cullBackFaces,
1934-
scratchRayIntersection
1926+
const mousePos = pickPosition(
1927+
controller,
1928+
movement.startPosition,
1929+
scratchMousePosition
19351930
);
19361931
if (defined(mousePos)) {
19371932
let strafing = false;

0 commit comments

Comments
 (0)