Remove obsolete Gauss1D/Gauss2D functions.
This commit is contained in:
@@ -138,19 +138,6 @@ namespace OpenRA
|
|||||||
r.Next(w.Map.Bounds.Top, w.Map.Bounds.Bottom));
|
r.Next(w.Map.Bounds.Top, w.Map.Bounds.Bottom));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static float Gauss1D(this Thirdparty.Random r, int samples)
|
|
||||||
{
|
|
||||||
return Exts.MakeArray(samples, _ => r.NextFloat() * 2 - 1f)
|
|
||||||
.Sum() / samples;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Returns a random offset in the range [-1..1,-1..1] with a separable
|
|
||||||
// Gauss distribution with 'samples' values taken for each axis
|
|
||||||
public static float2 Gauss2D(this Thirdparty.Random r, int samples)
|
|
||||||
{
|
|
||||||
return new float2(Gauss1D(r, samples), Gauss1D(r, samples));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool HasVoices(this Actor a)
|
public static bool HasVoices(this Actor a)
|
||||||
{
|
{
|
||||||
var selectable = a.Info.Traits.GetOrDefault<SelectableInfo>();
|
var selectable = a.Info.Traits.GetOrDefault<SelectableInfo>();
|
||||||
|
|||||||
@@ -101,8 +101,8 @@ namespace OpenRA.Mods.RA
|
|||||||
var renderables = new List<IRenderable>();
|
var renderables = new List<IRenderable>();
|
||||||
if (Game.CosmeticRandom.Next(2) != 0)
|
if (Game.CosmeticRandom.Next(2) != 0)
|
||||||
{
|
{
|
||||||
var p1 = from + (1 / 3f) * dist + Game.CosmeticRandom.Gauss1D(1) * .2f * dist.Length * norm;
|
var p1 = from + (1 / 3f) * dist + WRange.FromPDF(Game.CosmeticRandom, 2).Range * dist.Length / 4096 * norm;
|
||||||
var p2 = from + (2 / 3f) * dist + Game.CosmeticRandom.Gauss1D(1) * .2f * dist.Length * norm;
|
var p2 = from + (2 / 3f) * dist + WRange.FromPDF(Game.CosmeticRandom, 2).Range * dist.Length / 4096 * norm;
|
||||||
|
|
||||||
renderables.AddRange(DrawZap(wr, from, p1, s, out p1));
|
renderables.AddRange(DrawZap(wr, from, p1, s, out p1));
|
||||||
renderables.AddRange(DrawZap(wr, p1, p2, s, out p2));
|
renderables.AddRange(DrawZap(wr, p1, p2, s, out p2));
|
||||||
@@ -110,7 +110,7 @@ namespace OpenRA.Mods.RA
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var p1 = from + (1 / 2f) * dist + Game.CosmeticRandom.Gauss1D(1) * .2f * dist.Length * norm;
|
var p1 = from + (1 / 2f) * dist + WRange.FromPDF(Game.CosmeticRandom, 2).Range * dist.Length / 4096 * norm;
|
||||||
|
|
||||||
renderables.AddRange(DrawZap(wr, from, p1, s, out p1));
|
renderables.AddRange(DrawZap(wr, from, p1, s, out p1));
|
||||||
renderables.AddRange(DrawZap(wr, p1, to, s, out z));
|
renderables.AddRange(DrawZap(wr, p1, to, s, out z));
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ namespace OpenRA.Mods.RA
|
|||||||
length = (finalPos - initialPos).Length / info.Velocity;
|
length = (finalPos - initialPos).Length / info.Velocity;
|
||||||
|
|
||||||
// Facing rotation
|
// Facing rotation
|
||||||
rotation = Game.CosmeticRandom.Gauss1D(2) * info.ROT;
|
rotation = WRange.FromPDF(Game.CosmeticRandom, 2).Range * info.ROT / 1024;
|
||||||
|
|
||||||
var anim = new Animation(rs.GetImage(self), () => (int)facing);
|
var anim = new Animation(rs.GetImage(self), () => (int)facing);
|
||||||
anim.PlayRepeating(info.Anim);
|
anim.PlayRepeating(info.Anim);
|
||||||
|
|||||||
Reference in New Issue
Block a user