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
41 lines
973 B
C#
41 lines
973 B
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 Vector3d
|
|
{
|
|
public readonly double X;
|
|
public readonly double Y;
|
|
public readonly double Z;
|
|
|
|
public Vector3d(double x, double y, double z)
|
|
{
|
|
X = x;
|
|
Y = y;
|
|
Z = z;
|
|
}
|
|
|
|
public 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 Vector3d(tuple.Item1, tuple.Item2, tuple.Item3);
|
|
}
|
|
|
|
public static implicit operator Vector3d(Vector3 vector)
|
|
{
|
|
return new Vector3d(vector.X, vector.Y, vector.Z);
|
|
}
|
|
}
|
|
}
|