mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
update a bunch of packages and use JetBrains.Annotations as private asset as needed mark some hot math methods agg inline to benefit from loop opts use FMA for interp use canny min/max/clamp make Quaternion NormalizeAngle fixed time and faster clean up YamlDotNet references
44 lines
1.1 KiB
C#
44 lines
1.1 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
using Math = CannyFastMath.Math;
|
|
using MathF = CannyFastMath.MathF;
|
|
|
|
namespace Robust.Shared.Maths
|
|
{
|
|
[Serializable]
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public readonly struct Vector4d
|
|
{
|
|
public readonly double X;
|
|
public readonly double Y;
|
|
public readonly double Z;
|
|
public readonly double W;
|
|
|
|
public Vector4d(double x, double y, double z, double w)
|
|
{
|
|
X = x;
|
|
Y = y;
|
|
Z = z;
|
|
W = w;
|
|
}
|
|
|
|
public 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 Vector4d(tuple.Item1, tuple.Item2, tuple.Item3, tuple.Item4);
|
|
}
|
|
|
|
public static implicit operator Vector4d(Vector4 vector)
|
|
{
|
|
return new Vector4d(vector.X, vector.Y, vector.Z, vector.W);
|
|
}
|
|
}
|
|
}
|