(controller, startPosition, movement)
| 987 | const scratchTranslateP0 = new Cartesian3(); |
| 988 | |
| 989 | function translate2D(controller, startPosition, movement) { |
| 990 | const scene = controller._scene; |
| 991 | const camera = scene.camera; |
| 992 | let start = camera.getPickRay( |
| 993 | movement.startPosition, |
| 994 | translate2DStart, |
| 995 | ).origin; |
| 996 | let end = camera.getPickRay(movement.endPosition, translate2DEnd).origin; |
| 997 | |
| 998 | start = Cartesian3.fromElements(start.y, start.z, start.x, start); |
| 999 | end = Cartesian3.fromElements(end.y, end.z, end.x, end); |
| 1000 | |
| 1001 | const direction = Cartesian3.subtract(start, end, scratchTranslateP0); |
| 1002 | const distance = Cartesian3.magnitude(direction); |
| 1003 | |
| 1004 | if (distance > 0.0) { |
| 1005 | Cartesian3.normalize(direction, direction); |
| 1006 | camera.move(direction, distance); |
| 1007 | } |
| 1008 | } |
| 1009 | |
| 1010 | function zoom2D(controller, startPosition, movement) { |
| 1011 | if (defined(movement.distance)) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…