Esempio n. 1
0
        protected internal override void Update()
        {
            return;

            if (Input.Triggering(System.Windows.Input.Key.Enter))
            {
                for (int i = 0; i < 25; i++)
                {
                    Vector3D pos = Planet.RandomDirection();
                    pos.z = 0;

                    pos.Normalize();
                    //pos *= 1 / EngineInitializer.r.NextDouble();

                    Sphere p = new Sphere()
                    {
                        Position = pos * ((EngineInitializer.r.NextDouble() * 1D) + 0.5D), Scale = Vector3D.Positive * 0.015D * (EngineInitializer.r.NextDouble()) + 0.01D
                    };

                    Planet pla = p.AddModule <Planet>();

                    Physics phy = pla.Malleable.AddModule <Physics>();//p.Module<Physics>();

                    pla.Physic = phy;
                    phy.AttractedByGlobalGravity = false;
                    phy.Mass     = Malleable.Scale.z * Malleable.Scale.z * Malleable.Scale.z * 1E+8;
                    phy.Velocity = EQuaternion.FromEuler(0, 0, 90D) * p.Position.Direction * -1.0D;
                }
            }
        }
Esempio n. 2
0
        protected internal override void Update()
        {
            //Log.Print(Camera.Main.Malleable.Rotation);

            if (Input.CursorMode == CursorLockMode.Locked)
            {
                MouseRotation += (Vector2D)Input.CursorMovement * MouseSensivity * Time.DeltaTime;
            }

            if (MouseRotation.x < 0)
            {
                MouseRotation.x = MouseRotation.x + 360;
            }
            if (MouseRotation.x > 360)
            {
                MouseRotation.x = MouseRotation.x - 360;
            }
            if (MouseRotation.y < -90)
            {
                MouseRotation.y = -90;
            }
            if (MouseRotation.y > 90)
            {
                MouseRotation.y = 90;
            }


            if (Input.Triggering(Key.B))
            {
                Camera.Main.FieldOfView -= 10;
            }
            if (Input.Triggering(Key.N))
            {
                Camera.Main.FieldOfView += 10;
            }

            if (Input.Triggering(Key.Enter))
            {
                Graphics.ResolutionLockMode =
                    (Graphics.ResolutionLockMode == Graphics.LockMode.Size ? Graphics.LockMode.None : Graphics.LockMode.Size);

                if (Graphics.ResolutionLockMode == Graphics.LockMode.Size)
                {
                    Size s = GameWindow.Instance.Render.Size;
                    //Graphics.RenderResolution = new Vector2I(s.Width / 8, s.Height / 8);

                    // Graphics.RenderSizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
                }

                else
                {
                    //  Graphics.RenderSizeMode = System.Windows.Forms.PictureBoxSizeMode.Normal;
                }
            }


            Camera.Main.Malleable.Rotation = EQuaternion.FromEuler(MouseRotation.y, MouseRotation.x, Roll);
        }