public static ZoomEvent ToZoomEvent(this ZoomEventDto zoomEventDto)
        {
            var zoomEvent = new ZoomEvent
            {
                Delta        = zoomEventDto.delta,
                Camera       = zoomEventDto.camera.ToCamera(),
                CanvasWidth  = zoomEventDto.canvasWidth,
                CanvasHeight = zoomEventDto.canvasHeight
            };

            return(zoomEvent);
        }
Exemple #2
0
        public SceneStateDto Zoom(ZoomEventDto zoomEventDto)
        {
            _scene.SetBodyStates(zoomEventDto.BodyStates);
            var zoomEvent    = zoomEventDto.ToZoomEvent();
            var zoomedCamera = _view.Zoom(zoomEvent);
            var lines        = _hiddenLineService.GetHiddenLineGraphics(_scene, zoomedCamera, zoomEvent.CanvasWidth, zoomEvent.CanvasHeight).ToArray();
            var sceneState   = new SceneStateDto()
            {
                Camera     = zoomedCamera.ToCameraDto(),
                BodyStates = _scene.GetBodyStates(),
                DrawLines  = lines
            };

            return(sceneState);
        }
Exemple #3
0
        public ActionResult <SceneStateDto> Zoom([FromBody] ZoomEventDto zoomEventDto)
        {
            var sceneState = _logicView.Zoom(zoomEventDto);

            return(Ok(sceneState));
        }