Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetDynamicNoise() [3/3]

static float Terraria.GameContent.RGB.NoiseHelper.GetDynamicNoise ( Vector2 position,
float currentTime )
inlinestatic

Definition at line 61 of file NoiseHelper.cs.

62 {
63 position *= 10f;
64 currentTime %= 1f;
65 Vector2 vector = new Vector2((float)Math.Floor(position.X), (float)Math.Floor(position.Y));
66 Point point = new Point((int)vector.X, (int)vector.Y);
67 Vector2 vector2 = new Vector2(position.X - vector.X, position.Y - vector.Y);
68 float value = MathHelper.Lerp(GetDynamicNoiseInternal(point.X, point.Y, currentTime), GetDynamicNoiseInternal(point.X, point.Y + 1, currentTime), vector2.Y);
69 float value2 = MathHelper.Lerp(GetDynamicNoiseInternal(point.X + 1, point.Y, currentTime), GetDynamicNoiseInternal(point.X + 1, point.Y + 1, currentTime), vector2.Y);
70 return MathHelper.Lerp(value, value2, vector2.X);
71 }
static float Lerp(float value1, float value2, float amount)
Definition MathHelper.cs:53
static double Floor(double d)
static float GetDynamicNoiseInternal(int x, int y, float wrappedTime)

References System.Math.Floor(), Terraria.GameContent.RGB.NoiseHelper.GetDynamicNoiseInternal(), Microsoft.Xna.Framework.MathHelper.Lerp(), System.value, Microsoft.Xna.Framework.Point.X, Microsoft.Xna.Framework.Vector2.X, Microsoft.Xna.Framework.Point.Y, and Microsoft.Xna.Framework.Vector2.Y.