mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 04:58:24 +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,100 @@
|
|||
// <auto-generated /> - edit Matrix.operators.tt to modify
|
||||
#nullable enable
|
||||
|
||||
namespace Brutal.Numerics;
|
||||
|
||||
public partial struct float4x4
|
||||
{
|
||||
/// <inheritdoc cref="Matrix4x4.op_Addition(Matrix4x4, Matrix4x4)" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static float4x4 operator +(float4x4 left, float4x4 right)
|
||||
{
|
||||
float4x4 result;
|
||||
|
||||
result.X = left.X + right.X;
|
||||
result.Y = left.Y + right.Y;
|
||||
result.Z = left.Z + right.Z;
|
||||
result.W = left.W + right.W;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Matrix4x4.op_Equality(Matrix4x4, Matrix4x4)" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool operator ==(float4x4 left, float4x4 right)
|
||||
{
|
||||
return left.X == right.X && left.Y == right.Y && left.Z == right.Z && left.W == right.W;
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Matrix4x4.op_Inequality(Matrix4x4, Matrix4x4)" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool operator !=(float4x4 left, float4x4 right)
|
||||
{
|
||||
return left.X != right.X || left.Y != right.Y || left.Z != right.Z || left.W != right.W;
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Matrix4x4.op_Multiply(Matrix4x4, Matrix4x4)" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static float4x4 operator *(float4x4 left, float4x4 right)
|
||||
{
|
||||
ref readonly var l = ref left.AsRows();
|
||||
ref readonly var r = ref right.AsRows();
|
||||
|
||||
var result = new Rows(
|
||||
r.Transform(l.X),
|
||||
r.Transform(l.Y),
|
||||
r.Transform(l.Z),
|
||||
r.Transform(l.W));
|
||||
|
||||
return Unsafe.BitCast<Rows, float4x4>(result);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Multiply(float4x4, float4)" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static float4 operator *(float4x4 matrix, float4 vector)
|
||||
{
|
||||
return Multiply(matrix, vector);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Matrix4x4.op_Multiply(Matrix4x4, float)" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static float4x4 operator *(float4x4 left, float right)
|
||||
{
|
||||
float4x4 result;
|
||||
|
||||
result.X = left.X * right;
|
||||
result.Y = left.Y * right;
|
||||
result.Z = left.Z * right;
|
||||
result.W = left.W * right;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Matrix4x4.op_Subtraction(Matrix4x4, Matrix4x4)" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static float4x4 operator -(float4x4 left, float4x4 right)
|
||||
{
|
||||
float4x4 result;
|
||||
|
||||
result.X = left.X - right.X;
|
||||
result.Y = left.Y - right.Y;
|
||||
result.Z = left.Z - right.Z;
|
||||
result.W = left.W - right.W;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="Matrix4x4.op_UnaryNegation(Matrix4x4)" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static float4x4 operator -(float4x4 value)
|
||||
{
|
||||
float4x4 result;
|
||||
|
||||
result.X = -value.X;
|
||||
result.Y = -value.Y;
|
||||
result.Z = -value.Z;
|
||||
result.W = -value.W;
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue