Exemplo n.º 1
0
 public void Update(double deltaTime)
 {
     Color.Update(deltaTime);
     offset  += Speed * (float)deltaTime;
     offset.X = MMWMath.Repeat(offset.X, 0.0f, Texture.Size.Width);
     offset.Y = MMWMath.Repeat(offset.Y, 0.0f, Texture.Size.Height);
 }
Exemplo n.º 2
0
 public void Update(double deltaTime)
 {
     if (Rate < 1.0f)
     {
         nowTrans += deltaTime;
         Rate      = MMWMath.Saturate((float)(nowTrans / trans));
     }
 }
Exemplo n.º 3
0
 public void Update(double deltaTime)
 {
     if (deltaTime > 0.1)
     {
         return;
     }
     if (Type == TransitType.Lerp)
     {
         var rate = MMWMath.Saturate((float)deltaTime * Speed);
         LocalLocation = Vector2.Lerp(LocalLocation, Target, rate);
     }
 }
Exemplo n.º 4
0
        protected override void Update(double deltaTime)
        {
            //targetY -= Input.MouseDelta.X * (float)deltaTime * 0.05f;
            //targetX += Input.MouseDelta.Y * (float)deltaTime * 0.05f;
            //targetY = MathHelper.Clamp(targetY, -0.1f, 0.1f);
            //targetX = MathHelper.Clamp(targetX, -0.1f, 0.1f);
            targetY -= Input.MouseDelta.X * (float)deltaTime * 0.5f;
            targetX += Input.MouseDelta.Y * (float)deltaTime * 0.5f;
            //targetY = MathHelper.Clamp(targetY, -2f, 2f);
            //targetX = MathHelper.Clamp(targetX, -2f, 2f);

            if (Input.IsKeyDown(OpenTK.Input.Key.Space))
            {
                MMW.MainCamera.FoV = MathHelper.PiOver6 * 0.5f;
            }
            else
            {
                MMW.MainCamera.FoV = MathHelper.PiOver3;
            }

            GameObject.Transform.Rotate.Y = MMWMath.Lerp(GameObject.Transform.Rotate.Y, targetY, 0.1f);
            GameObject.Transform.Rotate.X = MMWMath.Lerp(GameObject.Transform.Rotate.X, targetX, 0.1f);
        }
Exemplo n.º 5
0
 public void Update(double deltaTime)
 {
     Now = MMWMath.Lerp(Now, Target, (float)deltaTime * Speed);
 }
Exemplo n.º 6
0
        protected override void Update(double deltaTime)
        {
            base.Update(deltaTime);

            if (Input.IsKeyPressed(Key.F1))
            {
                Visible = !Visible;
            }

            if (!Visible)
            {
                return;
            }

            //var pl = MMW.FindGameComponent<PointLight>();

            if (Input.IsKeyPressed(Key.Up))
            {
                index = MMWMath.Repeat(index - 1, 0, 13);
            }
            if (Input.IsKeyPressed(Key.Down))
            {
                index = MMWMath.Repeat(index + 1, 0, 13);
            }

            if (Input.IsKeyDown(Key.Right))
            {
                if (index == 0)
                {
                    MMW.Contrast += (float)deltaTime;
                }
                if (index == 1)
                {
                    MMW.Saturation += (float)deltaTime;
                }
                if (index == 2)
                {
                    MMW.Brightness += (float)deltaTime;
                }
                if (index == 3)
                {
                    MMW.IBLIntensity += (float)deltaTime;
                }
                if (index == 4)
                {
                    MMW.GlobalAmbient = new Color4(MMW.GlobalAmbient.R + (float)deltaTime, MMW.GlobalAmbient.G + (float)deltaTime, MMW.GlobalAmbient.B + (float)deltaTime, 0.0f);
                }
                if (index == 5)
                {
                    MMW.MainCamera.FoV = MMWMath.Clamp(MMW.MainCamera.FoV + (float)deltaTime, 0.01f, 3.0f);
                }
                if (index == 6)
                {
                    MMW.DirectionalLight.Intensity += (float)deltaTime;
                }
                if (index == 7)
                {
                    MMW.FogIntensity += (float)deltaTime;
                }
            }
            if (Input.IsKeyDown(Key.Left))
            {
                if (index == 0)
                {
                    MMW.Contrast -= (float)deltaTime;
                }
                if (index == 1)
                {
                    MMW.Saturation -= (float)deltaTime;
                }
                if (index == 2)
                {
                    MMW.Brightness -= (float)deltaTime;
                }
                if (index == 3)
                {
                    MMW.IBLIntensity -= (float)deltaTime;
                }
                if (index == 4)
                {
                    MMW.GlobalAmbient = new Color4(MMW.GlobalAmbient.R - (float)deltaTime, MMW.GlobalAmbient.G - (float)deltaTime, MMW.GlobalAmbient.B - (float)deltaTime, 0.0f);
                }
                if (index == 5)
                {
                    MMW.MainCamera.FoV = MMWMath.Clamp(MMW.MainCamera.FoV - (float)deltaTime, 0.01f, 3.0f);
                }
                if (index == 6)
                {
                    MMW.DirectionalLight.Intensity -= (float)deltaTime;
                }
                if (index == 7)
                {
                    MMW.FogIntensity -= (float)deltaTime;
                }
            }

            var texts = new string[]
            {
                "Contrast : " + MMW.Contrast,
                "Saturation : " + MMW.Saturation,
                "Brightness : " + MMW.Brightness,
                "IBL Intensity : " + MMW.IBLIntensity,
                "Ambient : " + MMW.GlobalAmbient.R,
                "FoV : " + MMW.MainCamera.FoV,
                "Intensity : " + MMW.DirectionalLight.Intensity,
                "Fog : " + MMW.FogIntensity,
                "Dir : " + MMW.DirectionalLight.Direction,
                "Local Dir : " + MMW.DirectionalLight.LocalDirection,
                "World Dir : " + MMW.DirectionalLight.WorldDirection,
            };

            for (var i = 0; i < texts.Length; i++)
            {
                if (index == i)
                {
                    texts[i] = texts[i].Insert(0, "> ");
                }
                else
                {
                    texts[i] = texts[i].Insert(0, "  ");
                }
            }

            var idx = 0;

            for (var i = 0; i < texts.Length; i++)
            {
                SetText(idx++, texts[i]);
            }

            for (var i = idx; i < 128; i++)
            {
                SetText(i, "", 0, i * 16.0f);
            }
        }