Beispiel #1
0
        float GetNewHeight(SurfacePoint point, double deltaTime)
        {
            float average = 0;

            foreach (var item in point.Neightbours)
            {
                average += item.Height * (float)deltaTime / 1000;
            }

            average /= point.Neightbours.Count();

            float difference = average - point.Height;

            return(point.Height + difference * 0.8f);
        }
Beispiel #2
0
 public float Distance(SurfacePoint a, SurfacePoint b)
 {
     return((float)Math.Sqrt(Math.Pow((b.X - a.X), 2) + Math.Pow((b.Y - a.Y), 2)));
 }
Beispiel #3
0
 public void AddSource(SurfacePoint source)
 {
     Sources.Add(source);
 }