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.
40 lines
883 B
C#
40 lines
883 B
C#
using System;
|
|
using System.Numerics;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace Robust.Shared.Maths
|
|
{
|
|
[Serializable]
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public struct Vector3d
|
|
{
|
|
public double X;
|
|
public double Y;
|
|
public double Z;
|
|
|
|
public Vector3d(double x, double y, double z)
|
|
{
|
|
X = x;
|
|
Y = y;
|
|
Z = z;
|
|
}
|
|
|
|
public readonly void Deconstruct(out double x, out double y, out double z)
|
|
{
|
|
x = X;
|
|
y = Y;
|
|
z = Z;
|
|
}
|
|
|
|
public static implicit operator Vector3d((double, double, double) tuple)
|
|
{
|
|
return new(tuple.Item1, tuple.Item2, tuple.Item3);
|
|
}
|
|
|
|
public static implicit operator Vector3d(Vector3 vector)
|
|
{
|
|
return new(vector.X, vector.Y, vector.Z);
|
|
}
|
|
}
|
|
}
|