Esempio n. 1
0
        public static float GetDynamicNoise(Vector2 position, float currentTime)
        {
            position    *= 10f;
            currentTime %= 1f;
            Vector2 vector2_1 = new Vector2((float)Math.Floor((double)position.X), (float)Math.Floor((double)position.Y));
            Point   point     = new Point((int)vector2_1.X, (int)vector2_1.Y);
            Vector2 vector2_2 = new Vector2(position.X - vector2_1.X, position.Y - vector2_1.Y);

            return(MathHelper.Lerp(MathHelper.Lerp(NoiseHelper.GetDynamicNoiseInternal(point.X, point.Y, currentTime), NoiseHelper.GetDynamicNoiseInternal(point.X, point.Y + 1, currentTime), vector2_2.Y), MathHelper.Lerp(NoiseHelper.GetDynamicNoiseInternal(point.X + 1, point.Y, currentTime), NoiseHelper.GetDynamicNoiseInternal(point.X + 1, point.Y + 1, currentTime), vector2_2.Y), vector2_2.X));
        }
Esempio n. 2
0
 public static float GetDynamicNoise(int x, int y, float currentTime)
 {
     return(NoiseHelper.GetDynamicNoiseInternal(x, y, currentTime % 1f));
 }