mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-28 05:58:25 +01:00
SOURCE DUMP v1
This commit is contained in:
parent
bd62d51ec9
commit
fb20299e9d
1 changed files with 768360 additions and 0 deletions
|
|
@ -0,0 +1,93 @@
|
|||
// <auto-generated /> - edit Matrix.tt to modify
|
||||
#nullable enable
|
||||
|
||||
namespace Brutal.Numerics;
|
||||
|
||||
/// <summary>
|
||||
/// Implements a 3x2 matrix with double components.
|
||||
/// </summary>
|
||||
[DebuggerTypeProxy(typeof(DebugView))]
|
||||
public partial struct double3x2 : IMatrix<double3x2, double>
|
||||
, IFloatingMatrix3x2<double3x2, double, double2, double3>
|
||||
{
|
||||
internal class DebugView(double3x2 m)
|
||||
{
|
||||
public double2 X => m.X;
|
||||
public double2 Y => m.Y;
|
||||
public double2 Z => m.Z;
|
||||
}
|
||||
|
||||
/// <summary>The first row of the matrix.</summary>
|
||||
[XmlIgnore]
|
||||
public double2 X;
|
||||
|
||||
/// <summary>The second row of the matrix.</summary>
|
||||
[XmlIgnore]
|
||||
public double2 Y;
|
||||
|
||||
/// <summary>The third row of the matrix.</summary>
|
||||
[XmlIgnore]
|
||||
public double2 Z;
|
||||
|
||||
/// <inheritdoc cref="Matrix3x2(float, float, float, float, float, float)" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public double3x2(
|
||||
double m11,
|
||||
double m12,
|
||||
double m21,
|
||||
double m22,
|
||||
double m31,
|
||||
double m32
|
||||
)
|
||||
{
|
||||
X = new double2(m11, m12);
|
||||
Y = new double2(m21, m22);
|
||||
Z = new double2(m31, m32);
|
||||
}
|
||||
|
||||
/// <summary>Creates a matrix from the leading 6 elements of a span, row by row.</summary>
|
||||
/// <param name="span">The elements to read; must contain at least 6, and any beyond that are ignored.</param>
|
||||
/// <exception cref="ArgumentOutOfRangeException"><paramref name="span" /> holds fewer than 6 elements.</exception>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public double3x2(ReadOnlySpan<double> span)
|
||||
{
|
||||
if (span.Length < 6)
|
||||
throw new ArgumentOutOfRangeException(nameof(span), "Length must be at least 6.");
|
||||
|
||||
this = Unsafe.ReadUnaligned<double3x2>(ref Unsafe.As<double, byte>(ref MemoryMarshal.GetReference(span)));
|
||||
}
|
||||
|
||||
static double3x2 IMatrix<double3x2, double>.Create(ReadOnlySpan<double> span) => new(span);
|
||||
|
||||
/// <inheritdoc />
|
||||
public static double3x2 Identity
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get
|
||||
{
|
||||
double3x2 result;
|
||||
|
||||
result.X = double2.UnitX;
|
||||
result.Y = double2.UnitY;
|
||||
result.Z = double2.Zero;
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public static int ComponentSize => sizeof(double);
|
||||
|
||||
/// <inheritdoc />
|
||||
public static int RowCount => 3;
|
||||
|
||||
/// <inheritdoc />
|
||||
public static int ColumnCount => 2;
|
||||
|
||||
/// <inheritdoc cref="Matrix3x2.IsIdentity" />
|
||||
public readonly bool IsIdentity
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get => X == double2.UnitX && Y == double2.UnitY && Z == double2.Zero;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue