daily update on 20240413 by nitload youmu, camera complete

This commit is contained in:
YoumuLiu
2024-04-13 04:04:14 +08:00
parent f0f80f72f1
commit 7c755fe1e2
99 changed files with 1351 additions and 1119 deletions
@@ -11,38 +11,46 @@ namespace StgSharp.Math
{
internal const float DegToRad = 180 / Scaler.Pi;
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Degree ToDegree(float value)
{
return new Degree(value);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float Sin(Radius r)
{
return MathF.Sin(r._radius);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float Tan(Radius r)
{
return MathF.Tan(r._radius);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float Cos(Radius r)
{
return MathF.Cos(r._radius);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float Sin(Degree r)
{
return MathF.Sin(r._degree);
return MathF.Sin(r._degree/DegToRad);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float Tan(Degree r)
{
return MathF.Tan(r._degree);
return MathF.Tan(r._degree / DegToRad);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float Cos(Degree r)
{
return MathF.Cos(r._degree);
return MathF.Cos(r._degree / DegToRad);
}
}
@@ -56,9 +64,9 @@ namespace StgSharp.Math
_degree = dgree;
}
public Radius ToRadius()
public static implicit operator Radius(Degree d)
{
return new Radius(_degree / GeometryScaler.DegToRad);
return new Radius(d._degree / GeometryScaler.DegToRad);
}
}
@@ -79,9 +87,9 @@ namespace StgSharp.Math
[Obsolete("Unsafe, you may forget this is radius.",true)]
public Radius() { }
public Degree ToDegree()
public static implicit operator Degree(Radius r)
{
return new Degree(_radius * 180 / Scaler.Pi);
return new Degree(r._radius * 180 / Scaler.Pi);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]