mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
Vector3, Vector4, Matrix4, and Quaternion are now gone. Use System.Numerics instead. This commit is just replacing usages, cleaning up using declarations, and moving over the (couple) helpers that are actually important.
43 lines
1001 B
C#
43 lines
1001 B
C#
using System;
|
|
using System.Numerics;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace Robust.Shared.Maths
|
|
{
|
|
[Serializable]
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public struct Vector4d
|
|
{
|
|
public double X;
|
|
public double Y;
|
|
public double Z;
|
|
public double W;
|
|
|
|
public Vector4d(double x, double y, double z, double w)
|
|
{
|
|
X = x;
|
|
Y = y;
|
|
Z = z;
|
|
W = w;
|
|
}
|
|
|
|
public readonly void Deconstruct(out double x, out double y, out double z, out double w)
|
|
{
|
|
x = X;
|
|
y = Y;
|
|
z = Z;
|
|
w = W;
|
|
}
|
|
|
|
public static implicit operator Vector4d((double, double, double, double) tuple)
|
|
{
|
|
return new(tuple.Item1, tuple.Item2, tuple.Item3, tuple.Item4);
|
|
}
|
|
|
|
public static implicit operator Vector4d(Vector4 vector)
|
|
{
|
|
return new(vector.X, vector.Y, vector.Z, vector.W);
|
|
}
|
|
}
|
|
}
|