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

◆ GetStaticNoise() [3/3]

static float Terraria.GameContent.RGB.NoiseHelper.GetStaticNoise ( Vector2 position)
inlinestatic

Definition at line 73 of file NoiseHelper.cs.

74 {
75 position *= 10f;
76 Vector2 vector = new Vector2((float)Math.Floor(position.X), (float)Math.Floor(position.Y));
77 Point point = new Point((int)vector.X, (int)vector.Y);
78 Vector2 vector2 = new Vector2(position.X - vector.X, position.Y - vector.Y);
79 float value = MathHelper.Lerp(GetStaticNoise(point.X, point.Y), GetStaticNoise(point.X, point.Y + 1), vector2.Y);
80 float value2 = MathHelper.Lerp(GetStaticNoise(point.X + 1, point.Y), GetStaticNoise(point.X + 1, point.Y + 1), vector2.Y);
81 return MathHelper.Lerp(value, value2, vector2.X);
82 }
static float Lerp(float value1, float value2, float amount)
Definition MathHelper.cs:53
static double Floor(double d)
static float GetStaticNoise(int index)

References System.Math.Floor(), Terraria.GameContent.RGB.NoiseHelper.GetStaticNoise(), 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.