Beispiel #1
0
        void HandleKeyDown(KeyDownEventArgs e)
        {
            switch (e.Key)
            {
            case Key.Esc:
                Exit();
                return;

            case Key.F1:
                Console.Toggle();
                return;

            case Key.F2:
                DebugHud.ToggleAll();
                return;

            case Key.Up:
                PreviousPanelMode();
                return;

            case Key.Down:
                SetPanelMode(PanelMode.Node);
                return;
            }
        }
        void OnKeyDown(KeyDownEventArgs e)
        {
            switch (e.Key)
            {
            case Key.Esc:
                //Exit();
                break;

            case Key.R:
                RotateRootNode(false);
                rootNode.Rotation = new Quaternion(0, 0, 0);
                RotateRootNode(true);
                break;

            case Key.H:
                HandMode = !HandMode;
                break;

            case Key.Space:
                DrawDebugFrame = !DrawDebugFrame;
                break;

            case Key.Q:
                console?.Toggle();
                break;

            case Key.E:
                debugHud?.ToggleAll();
                break;

            case Key.KP_Plus:
                if (Input.GetKeyDown(Key.B))
                {
                    Brightness += 0.2f;
                }
                break;

            case Key.KP_Minus:
                if (Input.GetKeyDown(Key.B))
                {
                    Brightness -= 0.2f;
                }
                break;
            }
        }
Beispiel #3
0
        void HandleKeyDown(KeyDownEventArgs e)
        {
            switch (e.Key)
            {
            case Key.Esc:
                Exit();
                return;

            case Key.F1:
                console.Toggle();
                return;

            case Key.F2:
                debugHud.ToggleAll();
                return;

            case Key.F3:
                MainWindow.thisOne.showToolWindow();
                return;
            }

            var renderer = Renderer;

            switch (e.Key)
            {
            case Key.X:
                mobileMushroomMove = !mobileMushroomMove;
                break;

            case Key.N1:
                var quality = renderer.TextureQuality;
                ++quality;
                if (quality > 2)
                {
                    quality = 0;
                }
                renderer.TextureQuality = quality;
                break;

            case Key.N2:
                var mquality = renderer.MaterialQuality;
                ++mquality;
                if (mquality > 2)
                {
                    mquality = 0;
                }
                renderer.MaterialQuality = mquality;
                break;

            case Key.N3:
                renderer.SpecularLighting = !renderer.SpecularLighting;
                break;

            case Key.N4:
                renderer.DrawShadows = !renderer.DrawShadows;
                break;

            case Key.N5:
                var shadowMapSize = renderer.ShadowMapSize;
                shadowMapSize *= 2;
                if (shadowMapSize > 2048)
                {
                    shadowMapSize = 512;
                }
                renderer.ShadowMapSize = shadowMapSize;
                break;

            // shadow depth and filtering quality
            case Key.N6:
                var q = (int)renderer.ShadowQuality++;
                if (q > 3)
                {
                    q = 0;
                }
                renderer.ShadowQuality = (ShadowQuality)q;
                break;

            // occlusion culling
            case Key.N7:
                var o = !(renderer.MaxOccluderTriangles > 0);
                renderer.MaxOccluderTriangles = o ? 5000 : 0;
                break;

            // instancing
            case Key.N8:
                renderer.DynamicInstancing = !renderer.DynamicInstancing;
                break;

            case Key.N9:
                Image screenshot = new Image();
                Graphics.TakeScreenShot(screenshot);
                screenshot.SavePNG(FileSystem.ProgramDir + $"Data/Screenshot_{GetType().Name}_{DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss", CultureInfo.InvariantCulture)}.png");
                break;
            }
        }
Beispiel #4
0
        void HandleKeyDown(KeyDownEventArgs e)
        {
            switch (e.Key)
            {
            case Key.Esc:
                Engine.Exit();
                return;

            case Key.F1:
                console.Toggle();
                return;

            case Key.F2:
                debugHud.ToggleAll();
                return;
            }

            if (UI.FocusElement == null)
            {
                return;
            }

            var renderer = Renderer;

            switch (e.Key)
            {
            case Key.N1:
                var quality = renderer.TextureQuality;
                ++quality;
                if (quality > 2)
                {
                    quality = 0;
                }
                renderer.TextureQuality = quality;
                break;

            case Key.N2:
                var mquality = renderer.MaterialQuality;
                ++mquality;
                if (mquality > 2)
                {
                    mquality = 0;
                }
                renderer.MaterialQuality = mquality;
                break;

            case Key.N3:
                renderer.SpecularLighting = !renderer.SpecularLighting;
                break;

            case Key.N4:
                renderer.DrawShadows = !renderer.DrawShadows;
                break;

            case Key.N5:
                var shadowMapSize = renderer.ShadowMapSize;
                shadowMapSize *= 2;
                if (shadowMapSize > 2048)
                {
                    shadowMapSize = 512;
                }
                renderer.ShadowMapSize = shadowMapSize;
                break;

            // shadow depth and filtering quality
            case Key.N6:
                var q = renderer.ShadowQuality;
                q++;
                if (q > 3)
                {
                    q = 0;
                }
                renderer.ShadowQuality = q;
                break;

            // occlusion culling
            case Key.N7:
                var o = !(renderer.MaxOccluderTriangles > 0);
                renderer.MaxOccluderTriangles = o ? 5000 : 0;
                break;

            // instancing
            case Key.N8:
                renderer.DynamicInstancing = !renderer.DynamicInstancing;
                break;
            }
        }