mirror of
https://github.com/oliverbooth/VpSharp
synced 2024-11-22 13:48:48 +00:00
refactor!: remove ReadOnlySpan<double> ctor from Vector3d
This commit is contained in:
parent
87c63de53b
commit
13d3153a6a
@ -58,22 +58,6 @@ public struct Vector3d : IEquatable<Vector3d>, IFormattable
|
|||||||
Z = z;
|
Z = z;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Initializes a new instance of the <see cref="Vector3d" /> struct from the given
|
|
||||||
/// <see cref="ReadOnlySpan{Single}" />. The span must contain at least 3 elements.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="values">The span of elements to assign to the vector.</param>
|
|
||||||
/// <exception cref="ArgumentException"><paramref name="values" /> contains fewer than 3 elements.</exception>
|
|
||||||
public Vector3d(ReadOnlySpan<double> values)
|
|
||||||
{
|
|
||||||
if (values.Length < 3)
|
|
||||||
{
|
|
||||||
throw new ArgumentException("The specified span has an insufficient number of elements.", nameof(values));
|
|
||||||
}
|
|
||||||
|
|
||||||
this = Unsafe.ReadUnaligned<Vector3d>(ref Unsafe.As<double, byte>(ref MemoryMarshal.GetReference(values)));
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the length of the vector.
|
/// Gets the length of the vector.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user