@@ -929,7 +929,7 @@ describe("Scene/ScreenSpaceCameraController", function () {
929
929
) ;
930
930
} ) ;
931
931
932
- it ( "rotates in Columus view with camera transform set" , function ( ) {
932
+ it ( "rotates in Columbus view with camera transform set" , function ( ) {
933
933
setUpCV ( ) ;
934
934
935
935
const origin = Cartesian3 . fromDegrees ( - 72.0 , 40.0 ) ;
@@ -983,7 +983,7 @@ describe("Scene/ScreenSpaceCameraController", function () {
983
983
expect ( camera . position ) . not . toEqual ( position ) ;
984
984
} ) ;
985
985
986
- it ( "zooms in Columus view with camera transform set" , function ( ) {
986
+ it ( "zooms in Columbus view with camera transform set" , function ( ) {
987
987
setUpCV ( ) ;
988
988
989
989
const origin = Cartesian3 . fromDegrees ( - 72.0 , 40.0 ) ;
@@ -1198,6 +1198,70 @@ describe("Scene/ScreenSpaceCameraController", function () {
1198
1198
) ;
1199
1199
} ) ;
1200
1200
1201
+ it ( "zooms in on an object in 3D" , function ( ) {
1202
+ setUp3D ( ) ;
1203
+
1204
+ scene . globe = new MockGlobe ( scene . mapProjection . ellipsoid ) ;
1205
+
1206
+ updateController ( ) ;
1207
+
1208
+ const origin = Cartesian3 . fromDegrees ( - 72.0 , 40.0 , 1.0 ) ;
1209
+ camera . setView ( {
1210
+ destination : origin ,
1211
+ } ) ;
1212
+
1213
+ updateController ( ) ;
1214
+
1215
+ scene . pickPositionSupported = true ;
1216
+ scene . pickPositionWorldCoordinates = ( ) =>
1217
+ Cartesian3 . fromDegrees ( - 72.0 , 40.0 , - 10.0 ) ;
1218
+
1219
+ const position = Cartesian3 . clone ( camera . position ) ;
1220
+ const startPosition = new Cartesian2 ( 0 , 0 ) ;
1221
+ const endPosition = new Cartesian2 ( 0 , canvas . clientHeight / 2 ) ;
1222
+
1223
+ moveMouse ( MouseButtons . RIGHT , startPosition , endPosition ) ;
1224
+
1225
+ updateController ( ) ;
1226
+
1227
+ expect ( Cartesian3 . magnitude ( position ) ) . toBeGreaterThan (
1228
+ Cartesian3 . magnitude ( camera . position )
1229
+ ) ;
1230
+ } ) ;
1231
+
1232
+ it ( "zooms in on an object in 3D when transform is set" , function ( ) {
1233
+ setUp3D ( ) ;
1234
+
1235
+ scene . globe = new MockGlobe ( scene . mapProjection . ellipsoid ) ;
1236
+
1237
+ updateController ( ) ;
1238
+
1239
+ const origin = Cartesian3 . fromDegrees ( - 72.0 , 40.0 , 1.0 ) ;
1240
+ camera . lookAtTransform ( Transforms . eastNorthUpToFixedFrame ( origin ) , {
1241
+ heading : 0 ,
1242
+ pitch : 0 ,
1243
+ range : 10 ,
1244
+ } ) ;
1245
+
1246
+ updateController ( ) ;
1247
+
1248
+ scene . pickPositionSupported = true ;
1249
+ scene . pickPositionWorldCoordinates = ( ) =>
1250
+ Cartesian3 . fromDegrees ( - 72.0 , 40.0 , - 10.0 ) ;
1251
+
1252
+ const position = Cartesian3 . clone ( camera . position ) ;
1253
+ const startPosition = new Cartesian2 ( 0 , 0 ) ;
1254
+ const endPosition = new Cartesian2 ( 0 , canvas . clientHeight / 2 ) ;
1255
+
1256
+ moveMouse ( MouseButtons . RIGHT , startPosition , endPosition ) ;
1257
+
1258
+ updateController ( ) ;
1259
+
1260
+ expect ( Cartesian3 . magnitude ( position ) ) . toBeGreaterThan (
1261
+ Cartesian3 . magnitude ( camera . position )
1262
+ ) ;
1263
+ } ) ;
1264
+
1201
1265
it ( "zoom in 3D to point 0,0" , function ( ) {
1202
1266
setUp3D ( ) ;
1203
1267
scene . globe = new MockGlobe ( scene . mapProjection . ellipsoid ) ;
0 commit comments