add a pre-kP evaluation function in c

This commit is contained in:
Youmu Liu
2026-04-24 15:46:58 +08:00
parent 2f6617447c
commit 41350b0487
13 changed files with 169 additions and 154 deletions
+5 -13
View File
@@ -122,17 +122,9 @@ namespace StgSharp.Mathematics.Graphics
}
}
public static Vec4 One
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => new Vec4(1, 1, 1, 1);
}
public static Vec4 One => new Vec4(1, 1, 1, 1);
public static Vec4 Zero
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => new Vec4(0, 0, 0, 0);
}
public static Vec4 Zero => new Vec4(0, 0, 0, 0);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Vec4 Add(
@@ -152,7 +144,7 @@ namespace StgSharp.Mathematics.Graphics
object obj
)
{
return obj is Vec4 v && v == this;
return (obj is Vec4 v) && (v == this);
}
public static Vec4 FromSpan(
@@ -212,11 +204,11 @@ namespace StgSharp.Mathematics.Graphics
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Vec4 operator *(
Matrix44 mat,
GraphicsMatrix mat,
Vec4 vec
)
{
Matrix44 transpose = mat.Transpose;
GraphicsMatrix transpose = mat.Transpose;
return new Vec4(Vector4.Dot(transpose.mat.colum0, vec.vec),
Vector4.Dot(transpose.mat.colum1, vec.vec),
Vector4.Dot(transpose.mat.colum2, vec.vec),