Пример #1
0
 void Initialize()
 {
     water = new WaterSystem(Content, graphicsDevice, WaterPos, WaterSize, WaveLength, WaveHeight, WaveSpeed, Vector3.Negate(Vector3.Reflect(LightDirection, Vector3.Up)), LightColor, SunFactor);
     water.WaterHeight = WaterPos.Y;
 }
Пример #2
0
        public void ChangeGraphics()
        {
            oldKeyState = keyState;
            keyState = Keyboard.GetState();

            oldWaterState = WaterState;
            if (keyState.IsKeyDown(Keys.NumPad1))
                WaterState = 1;
            else if (keyState.IsKeyDown(Keys.NumPad2))
                WaterState = 2;
            else if (keyState.IsKeyDown(Keys.NumPad3))
                WaterState = 3;
            else if (keyState.IsKeyDown(Keys.NumPad4))
                WaterState = 4;
            else if (keyState.IsKeyDown(Keys.NumPad5))
                WaterState = 5;

            if (WaterState != oldWaterState)
                switch (WaterState)
                {
                    case 1:
                        WaveLength = 0.6f;
                        WaveHeight = 0.2f;
                        WaveSpeed = 0.004f;
                        water = new WaterSystem(Content, graphicsDevice, WaterPos, WaterSize, WaveLength, WaveHeight, WaveSpeed, Vector3.Negate(Vector3.Reflect(LightDirection, Vector3.Up)), LightColor, SunFactor);
                        break;
                    case 2:
                        WaveLength = 0.6f;
                        WaveHeight = 0.2f;
                        WaveSpeed = 0.04f;
                        water = new WaterSystem(Content, graphicsDevice, WaterPos, WaterSize, WaveLength, WaveHeight, WaveSpeed, Vector3.Negate(Vector3.Reflect(LightDirection, Vector3.Up)), LightColor, SunFactor);
                        break;
                    case 3:
                        WaveLength = 0.003f;
                        WaveHeight = 0.01f;
                        WaveSpeed = 0.02f;
                        water = new WaterSystem(Content, graphicsDevice, WaterPos, WaterSize, WaveLength, WaveHeight, WaveSpeed, Vector3.Negate(Vector3.Reflect(LightDirection, Vector3.Up)), LightColor, SunFactor);
                        break;
                    case 4:
                        WaveLength = 0.06f;
                        WaveHeight = 0.02f;
                        WaveSpeed = 0.004f;
                        water = new WaterSystem(Content, graphicsDevice, WaterPos, WaterSize, WaveLength, WaveHeight, WaveSpeed, Vector3.Negate(Vector3.Reflect(LightDirection, Vector3.Up)), LightColor, SunFactor);
                        break;
                }

            WaterState = 0;

            oldWater_Graph = Water_Graph;
            if (keyState.IsKeyDown(Keys.D1))
                Water_Graph = 1;
            else if (keyState.IsKeyDown(Keys.D2))
                Water_Graph = 2;
            else if (keyState.IsKeyDown(Keys.D3))
                Water_Graph = 3;
            else if (keyState.IsKeyDown(Keys.D4))
                Water_Graph = 4;
            else if (keyState.IsKeyDown(Keys.D5))
                Water_Graph = 5;

            switch (Water_Graph)
            {
                case 1: RemoveWaterModels(); break;
                case 2: RemoveWaterModels(); LowWater(); break;
                case 3: RemoveWaterModels(); MediumWater(); break;
                case 4: RemoveWaterModels(); HighWater(); break;
            }
        }
Пример #3
0
 public void UpdateLight(Vector3 LightColor, Vector3 LightDirection, float SunFactor)
 {
     this.LightColor = LightColor;
     this.LightDirection = LightDirection;
     this.SunFactor = SunFactor;
     water = new WaterSystem(Content, graphicsDevice, WaterPos, WaterSize, WaveLength, WaveHeight, WaveSpeed, Vector3.Negate(Vector3.Reflect(LightDirection, Vector3.Up)), LightColor, SunFactor);
 }