3 using Microsoft.Xna.Framework;
12 public float Scale {
get;
set; }
32 private Vector2[,] deformation;
41 float normalizedX = x / (float)(
Resolution.X - 1);
44 float normalizedY = y / (float)(
Resolution.X - 1);
46 Vector2 centerDiff =
new Vector2(normalizedX - 0.5f, normalizedY - 0.5f);
47 float centerDist = centerDiff.Length() * 2.0f;
48 if (centerDist == 0.0f)
continue;
50 deformation[x, y] = (centerDiff / centerDist) * Math.Min(1.0f, centerDist);
54 phase = Rand.Range(0.0f, MathHelper.TwoPi);
57 protected override void GetDeformation(out Vector2[,] deformation, out
float multiplier,
bool inverse)
59 deformation = this.deformation;
64 public override void Update(
float deltaTime)
69 phase %= MathHelper.TwoPi;