daily update on 20230302 by nitload youmu

This commit is contained in:
Nitload
2023-03-03 00:54:59 +08:00
parent bb71567e51
commit df2af2b2d5
37 changed files with 374 additions and 44 deletions
@@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Text;
namespace StgSharp.Math
{
public static unsafe partial class Vector
{
public static Vec3D To3D(this Vec2D vec)
{
return new Vec3D(vec.X, vec.Y, 0.0f);
}
public static Vec4D To4D(this Vec2D Vec)
{
return new Vec4D(Vec.X, Vec.Y, 0, 0);
}
public static Vec4D To4D(this Vec3D vec)
{
return new Vec4D(vec.X, vec.Y, vec.Z, 0);
}
public static Vec2D To2D(Vec3D vec, CordinatePlain plain)
{
switch (plain)
{
case CordinatePlain.XY:
return new Vec2D(vec.X, vec.Y);
break;
case CordinatePlain.YZ:
return new Vec2D(vec.Y, vec.Z);
break;
case CordinatePlain.XZ:
return new Vec2D(vec.X, vec.Z);
break;
default:
return default(Vec2D);
break;
}
}
}
}