daily update on 20240424 by nitloady youmu
This commit is contained in:
@@ -31,11 +31,11 @@
|
||||
namespace StgSharp.Math
|
||||
{
|
||||
|
||||
internal class Cordination
|
||||
internal class Coordination
|
||||
{
|
||||
}
|
||||
|
||||
public enum CordinatePlain
|
||||
public enum CoordinatePlain
|
||||
{
|
||||
XY,
|
||||
YZ,
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace StgSharp.Math
|
||||
}
|
||||
|
||||
public static Matrix44 Unit
|
||||
=> new Matrix44(
|
||||
=> new Matrix44(
|
||||
1, 0, 0, 0,
|
||||
0, 1, 0, 0,
|
||||
0, 0, 1, 0,
|
||||
|
||||
@@ -36,17 +36,17 @@ namespace StgSharp.Math
|
||||
public static unsafe partial class VectorCalc
|
||||
{
|
||||
|
||||
public static vec2d To2D(vec3d vec, CordinatePlain plain)
|
||||
public static vec2d To2D(vec3d vec, CoordinatePlain plain)
|
||||
{
|
||||
switch (plain)
|
||||
{
|
||||
case CordinatePlain.XY:
|
||||
case CoordinatePlain.XY:
|
||||
return new vec2d(vec.X, vec.Y);
|
||||
break;
|
||||
case CordinatePlain.YZ:
|
||||
case CoordinatePlain.YZ:
|
||||
return new vec2d(vec.Y, vec.Z);
|
||||
break;
|
||||
case CordinatePlain.XZ:
|
||||
case CoordinatePlain.XZ:
|
||||
return new vec2d(vec.X, vec.Z);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -178,6 +178,13 @@ namespace StgSharp.Math
|
||||
return new vec3d(vec.v / value);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static unsafe implicit operator vec3d((float, float, float) tuple)
|
||||
{
|
||||
vec3d v = *(vec3d*)&tuple;
|
||||
v.vec.W = 0.0f;
|
||||
return v;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static vec3d operator +(vec3d left, vec3d right)
|
||||
@@ -203,6 +210,7 @@ namespace StgSharp.Math
|
||||
return Cross(left,right) == Zero;
|
||||
}
|
||||
|
||||
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static vec3d Cross(vec3d left, vec3d right)
|
||||
|
||||
Reference in New Issue
Block a user