Exemplo n.º 1
0
        public override void Update(GraphicsDevice GD, GameSceneVariables GSV, GameTime GT = null, MouseState?MS = null, KeyboardState?KS = null)
        {
            for (int i = 0; i < GSV.WaterSize; i++)
            {
                for (int j = 0; j < GSV.WaterSize; j++)
                {
                    if (Indices[i, j] != null)
                    {
                        var Distortion = Utils.applyDistortion(new Vector3((i * Spacing) - Spacing / 2f, -85, (j * Spacing) - Spacing / 2f));
                        Distortion.X += TotalWaterSizeX * -0.5f + Spacing * 0.5f;
                        Distortion.Z += TotalWaterSizeZ * -0.5f + Spacing * 0.5f;

                        //for(int k = 0; k != Indices[i, j].Count(); k++)
                        //{
                        //    Vertices[Indices[i, j][k]].Position = Distortion;
                        //}
                        foreach (var b in Indices[i, j])
                        {
                            Vertices[b].Position = Distortion;
                        }
                    }
                }
            }

            Utils.GenerateNormals(ref Vertices);

            VertexBuffer.SetData(Vertices);
        }
Exemplo n.º 2
0
 public override void Update(GraphicsDevice GD, GameSceneVariables GSV, GameTime GT = null, MouseState?MS = null, KeyboardState?KS = null)
 {
 }
Exemplo n.º 3
0
 public override void Update(GraphicsDevice GD, GameSceneVariables GSV, GameTime GT = null, MouseState?MS = null, KeyboardState?KS = null)
 {
     //All of the movement is done in the shader with the help of the GS, PS and VS
     return;
 }