daily update on 20231016 by nitload youmu, vao,vbo,ebo struct added
This commit is contained in:
@@ -11,9 +11,9 @@ namespace StgSharp.Math
|
||||
[FieldOffset(0)] internal Mat3 mat;
|
||||
[FieldOffset(3 * 4 * sizeof(float))] internal Mat3 transpose;
|
||||
[FieldOffset(6 * 4 * sizeof(float))] internal bool isTransposed;
|
||||
[FieldOffset(0 * 4 * sizeof(float))] public Vec3d Colum0;
|
||||
[FieldOffset(1 * 4 * sizeof(float))] public Vec3d Colum1;
|
||||
[FieldOffset(2 * 4 * sizeof(float))] public Vec3d Colum2;
|
||||
[FieldOffset(0 * 4 * sizeof(float))] public vec3d Colum0;
|
||||
[FieldOffset(1 * 4 * sizeof(float))] public vec3d Colum1;
|
||||
[FieldOffset(2 * 4 * sizeof(float))] public vec3d Colum2;
|
||||
|
||||
public Matrix3x3(
|
||||
float a00, float a01, float a02,
|
||||
@@ -66,7 +66,10 @@ namespace StgSharp.Math
|
||||
}
|
||||
if (columNum > 2 || columNum < 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(columNum));
|
||||
internalIO.InternalWriteLog(
|
||||
$"Attempt to write unused space in {GetType().Name} {nameof(mat)}",
|
||||
LogType.Error
|
||||
);
|
||||
}
|
||||
InternalTranspose();
|
||||
fixed (float* p = &this.transpose.m00)
|
||||
@@ -142,6 +145,17 @@ namespace StgSharp.Math
|
||||
);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static vec3d operator *(Matrix3x3 left, vec3d right)
|
||||
{
|
||||
left.InternalTranspose();
|
||||
return new vec3d(
|
||||
Vector4.Dot(left.transpose.colum0, right.vec),
|
||||
Vector4.Dot(left.transpose.colum1, right.vec),
|
||||
Vector4.Dot(left.transpose.colum2, right.vec)
|
||||
);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Matrix3x2 operator *(Matrix3x3 left, Matrix3x2 right)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user