Daily update on 20230505 by nitload youmu, confuse on OpenGL
This commit is contained in:
@@ -90,6 +90,10 @@ namespace StgSharp.Math
|
||||
return new vec2d(vec.X/x, vec.Y/x);
|
||||
}
|
||||
|
||||
public static implicit operator float[](vec2d vec)
|
||||
{
|
||||
return new float[2] {vec.X,vec.Y };
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using StgSharp.Optimization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
using System.Runtime.InteropServices;
|
||||
@@ -6,7 +7,7 @@ using System.Text;
|
||||
|
||||
namespace StgSharp.Math
|
||||
{
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
[StructLayout(LayoutKind.Explicit,Size =12,Pack =16)]
|
||||
public struct vec3d : IEquatable<vec3d>
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
@@ -129,5 +130,20 @@ namespace StgSharp.Math
|
||||
vec.Z / x
|
||||
);
|
||||
}
|
||||
|
||||
public static implicit operator float[](vec3d vec)
|
||||
{
|
||||
return new float[3] { vec.X, vec.Y, vec.Y };
|
||||
}
|
||||
|
||||
public static implicit operator m128(vec3d vec)
|
||||
{
|
||||
return new m128()
|
||||
{
|
||||
float0 = vec.X,
|
||||
float1 = vec.Y,
|
||||
float2 = vec.Z,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,7 +138,10 @@ namespace StgSharp.Math
|
||||
return new vec4d(vec.X / x, vec.Y / x, vec.Z / x, vec.W / x);
|
||||
}
|
||||
|
||||
|
||||
public static implicit operator float[](vec4d vec)
|
||||
{
|
||||
return new float[] { vec.X, vec.Y, vec.Z, vec.W };
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user