Update content vectors to numerics (#17759)

This commit is contained in:
metalgearsloth
2023-07-08 14:08:32 +10:00
committed by GitHub
parent 15772478c9
commit 68480af109
383 changed files with 978 additions and 575 deletions

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Shared.Singularity.Components;
using Robust.Client.Graphics;
using Robust.Shared.Enums;
@@ -30,9 +31,9 @@ namespace Content.Client.Singularity
_shader.SetParameter("maxDistance", MaxDistance * EyeManager.PixelsPerMeter);
}
private Vector2[] _positions = new Vector2[MaxCount];
private float[] _intensities = new float[MaxCount];
private float[] _falloffPowers = new float[MaxCount];
private readonly Vector2[] _positions = new Vector2[MaxCount];
private readonly float[] _intensities = new float[MaxCount];
private readonly float[] _falloffPowers = new float[MaxCount];
private int _count = 0;
protected override bool BeforeDraw(in OverlayDrawArgs args)
@@ -49,7 +50,7 @@ namespace Content.Client.Singularity
var mapPos = xform.WorldPosition;
// is the distortion in range?
if ((mapPos - args.WorldAABB.ClosestPoint(mapPos)).LengthSquared > MaxDistance * MaxDistance)
if ((mapPos - args.WorldAABB.ClosestPoint(mapPos)).LengthSquared() > MaxDistance * MaxDistance)
continue;
// To be clear, this needs to use "inside-viewport" pixels.