enmergency update on 20230213 by nitload youmu, fix a file damage

This commit is contained in:
Nitload
2023-02-13 17:14:05 +08:00
parent 175f76ef29
commit 35cf242e7a
59 changed files with 416 additions and 102 deletions
+4 -4
View File
@@ -2,9 +2,9 @@
using System.Collections.Generic;
using System.Text;
namespace StgSharp
namespace StgSharp.Math
{
public static unsafe partial class Math
public static unsafe partial class Calc
{
@@ -69,9 +69,9 @@ namespace StgSharp
v = y + y * u;
}/**/
v = sign * v * 90 / piby2;
v = sign * v ;
return 90-v;
return piby2 - v;
}
}
}
+91 -7
View File
@@ -1,6 +1,4 @@
//
//
// some of the code is rewritten from the AMD code:
// some of the code is rewritten from the AMD code:
// https://github.com/amd/aocl-libm-ose/blob/a43e092b03213eb0e129a1cc129900e6e4475778/src/ref/asinf.c
@@ -8,9 +6,10 @@ using System;
using System.Collections.Generic;
using System.Text;
namespace StgSharp
namespace StgSharp.Math
{
public static unsafe partial class Math
public static unsafe partial class Calc
{
private const float
@@ -22,7 +21,7 @@ namespace StgSharp
/// <summary>
/// Reurns the value of ArcSin(x)
/// </summary>
/// <param name="x"></param>
/// <param name="x">The sine value of the angle</param>
/// <returns></returns>
/// <exception cref="ArgumentException"></exception>
public static float ASin(float x )
@@ -86,8 +85,93 @@ namespace StgSharp
v = y + y * u;
}/**/
return sign * v * 90 / piby2;
return sign * v;
}
/// <summary>
/// Returns the angle whose sine is the quotient of two specified numbers.
/// </summary>
/// <param name="x">The x coordinate of a point.</param>
/// <param name="y">The y coordinate of a point.</param>
/// <returns></returns>
/// <exception cref="ArgumentException"></exception>
public static unsafe float ASin(float x, float y)
{
bool isXNeg = (x < 0);
if (isXNeg)
{
x = -x;
}
float z = y /StgSharp.Math.Sqrt(x * x + y * y);
int sign = 1;
float t;
if (z < 0)
{
sign = -1;
t = -z;
}
else
{
t = z;
}
if (z > 1)
{
throw new ArgumentException();
}
float r, s, u, v = 0.0f;
bool transform = (t >= 0.5f);
if (transform)
{
r = 0.5f * (1.0f - t);
s = StgSharp.Math.Sqrt(r);
t = s;
}
else
{
r = t * t;
}
u = r * (0.184161606965100694821398249421F +
(-0.0565298683201845211985026327361F +
(-0.0133819288943925804214011424456F -
0.00396137437848476485201154797087F * r) * r) * r) /
(1.10496961524520294485512696706F -
0.836411276854206731913362287293F * r);
/**/
if (transform)
{
float c, s1, p, q;
uint us;
us = *(uint*)&s;
uint uss = us & 0xffff0000;
s1 = *(float*)&uss;
c = (r - s1 * s1) / (s + s1);
p = 2.0F * s * u - (piby2_tail - 2.0F * c);
q = hpiby2_head - 2.0F * s1;
v = hpiby2_head - (p - q);
}
else
{
v = t + t * u;
}/**/
if (isXNeg)
{
v = piby2 - x;
}
return sign * v;
}
}
}
+21
View File
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Text;
using System.Numerics;
namespace StgSharp.Math
{
public static unsafe partial class Calc
{
public static unsafe bool Equals<T>(T left,T right)
where T : notnull
{
if (typeof(T) == typeof(float))
{
return left.Equals(right);
}
}
}
}
+2 -2
View File
@@ -2,9 +2,9 @@
using System.Collections.Generic;
using System.Text;
namespace StgSharp
namespace StgSharp.Math
{
public static partial class Math
public static partial class Calc
{
public static float Cos(float x)
+2 -2
View File
@@ -2,9 +2,9 @@
using System.Collections.Generic;
using System.Text;
namespace StgSharp
namespace StgSharp.Math
{
public static unsafe partial class Math
public static unsafe partial class Calc
{
public const float E = 2.718281828f;
+2 -4
View File
@@ -2,11 +2,9 @@
using System.Collections.Generic;
using System.Text;
namespace StgSharp
namespace StgSharp.Math
{
public static unsafe partial class Math
public static unsafe partial class Calc
{
/// <summary>
+2 -5
View File
@@ -4,12 +4,9 @@ using System.Net.Sockets;
using System.Text;
using static System.Net.WebRequestMethods;
namespace StgSharp
namespace StgSharp.Math
{
public static partial class Math
public static partial class Calc
{
static private readonly float[] logArray =
+3 -3
View File
@@ -2,9 +2,9 @@
using System.Collections.Generic;
using System.Text;
namespace StgSharp
namespace StgSharp.Math
{
public static unsafe partial class Math
public static unsafe partial class Calc
{
/// <summary>
/// calculate the value of x^y
@@ -35,7 +35,7 @@ namespace StgSharp
{
return 1.0f / 0;
}
z = StgSharp.Math.Log(x) * y;
z = StgSharp.Math.Calc.Log(x) * y;
bool sign = false;
if (z < 0)
+2 -2
View File
@@ -2,9 +2,9 @@
using System.Collections.Generic;
using System.Text;
namespace StgSharp
namespace StgSharp.Math
{
public static partial class Math
public static partial class Calc
{
private static readonly float[] sinData =
{
+2 -2
View File
@@ -3,9 +3,9 @@ using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Text;
namespace StgSharp
namespace StgSharp.Math
{
public static partial class Math
public static partial class Clac
{
/*本方法将小数部分统一提升至2^16处后进行线性近似
const uint sqmov = 0b_0100_0111_1000_0000_0000_0000_0000_0000;
+2 -2
View File
@@ -2,9 +2,9 @@
using System.Collections.Generic;
using System.Text;
namespace StgSharp
namespace StgSharp.Math
{
public static partial class Math
public static partial class Calc
{
public static float Tan(float x)
+1
View File
@@ -14,6 +14,7 @@
<ItemGroup>
<PackageReference Include="GLFWDotNet" Version="20.9.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Steamworks.NET" Version="20.1.0" />
</ItemGroup>
</Project>
+34
View File
@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace StgSharp.Vector
{
public struct Vec2x1:IEquatable<Vec2x1>
{
float a1;
float a2;
public Vec2x1(float x,float y)
{
a1 = x;
a2 = y;
}
public bool Equals(Vec2x1 other)
{
return true;
}
public static bool operator ==(Vec2x1 vec1, Vec2x1 vec2)
{
return true;
}
public static bool operator !=(Vec2x1 vec1, Vec2x1 vec2)
{
return false;
}
}
}
@@ -10,7 +10,8 @@
"StgSharp/1.0.0": {
"dependencies": {
"GLFWDotNet": "20.9.0",
"Microsoft.CSharp": "4.7.0"
"Microsoft.CSharp": "4.7.0",
"Steamworks.NET": "20.1.0"
},
"runtime": {
"StgSharp.dll": {}
@@ -31,6 +32,14 @@
"fileVersion": "4.700.19.56404"
}
}
},
"Steamworks.NET/20.1.0": {
"runtime": {
"lib/netstandard2.1/Steamworks.NET.dll": {
"assemblyVersion": "20.1.0.0",
"fileVersion": "20.1.0.0"
}
}
}
}
},
@@ -53,6 +62,13 @@
"sha512": "sha512-pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==",
"path": "microsoft.csharp/4.7.0",
"hashPath": "microsoft.csharp.4.7.0.nupkg.sha512"
},
"Steamworks.NET/20.1.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-+GntwnyJ5tCNvUIaQxv2+ehDvZJzGUqlSB5xRBk1hTj1qqBJ6s4vK/OfGD/jae7aTmXiGSm8wpJORosNtQevJQ==",
"path": "steamworks.net/20.1.0",
"hashPath": "steamworks.net.20.1.0.nupkg.sha512"
}
}
}
@@ -8,7 +8,16 @@
<summary>
Reurns the value of ArcSin(x)
</summary>
<param name="x"></param>
<param name="x">The sine value of the angle</param>
<returns></returns>
<exception cref="T:System.ArgumentException"></exception>
</member>
<member name="M:StgSharp.Math.ASin(System.Single,System.Single)">
<summary>
Returns the angle whose sine is the quotient of two specified numbers.
</summary>
<param name="x">The x coordinate of a point.</param>
<param name="y">The y coordinate of a point.</param>
<returns></returns>
<exception cref="T:System.ArgumentException"></exception>
</member>
@@ -1 +1 @@
57d2afd7a707b689bdeb3640509f8f39355cee04
250cbfc0c4767a021cac96a098e779bd97d9c232
@@ -8,7 +8,16 @@
<summary>
Reurns the value of ArcSin(x)
</summary>
<param name="x"></param>
<param name="x">The sine value of the angle</param>
<returns></returns>
<exception cref="T:System.ArgumentException"></exception>
</member>
<member name="M:StgSharp.Math.ASin(System.Single,System.Single)">
<summary>
Returns the angle whose sine is the quotient of two specified numbers.
</summary>
<param name="x">The x coordinate of a point.</param>
<param name="y">The y coordinate of a point.</param>
<returns></returns>
<exception cref="T:System.ArgumentException"></exception>
</member>
@@ -52,6 +52,10 @@
"Microsoft.CSharp": {
"target": "Package",
"version": "[4.7.0, )"
},
"Steamworks.NET": {
"target": "Package",
"version": "[20.1.0, )"
}
},
"imports": [
@@ -33,6 +33,41 @@
"related": ".xml"
}
}
},
"Steamworks.NET/20.1.0": {
"type": "package",
"compile": {
"ref/netstandard2.1/Steamworks.NET.dll": {}
},
"runtime": {
"lib/netstandard2.1/Steamworks.NET.dll": {}
},
"runtimeTargets": {
"runtimes/linux-x64/lib/netstandard2.1/Steamworks.NET.dll": {
"assetType": "runtime",
"rid": "linux-x64"
},
"runtimes/linux-x86/lib/netstandard2.1/Steamworks.NET.dll": {
"assetType": "runtime",
"rid": "linux-x86"
},
"runtimes/osx-x64/lib/netstandard2.1/Steamworks.NET.dll": {
"assetType": "runtime",
"rid": "osx-x64"
},
"runtimes/osx-x86/lib/netstandard2.1/Steamworks.NET.dll": {
"assetType": "runtime",
"rid": "osx-x86"
},
"runtimes/win-x64/lib/netstandard2.1/Steamworks.NET.dll": {
"assetType": "runtime",
"rid": "win-x64"
},
"runtimes/win-x86/lib/netstandard2.1/Steamworks.NET.dll": {
"assetType": "runtime",
"rid": "win-x86"
}
}
}
}
},
@@ -121,12 +156,33 @@
"useSharedDesignerContext.txt",
"version.txt"
]
},
"Steamworks.NET/20.1.0": {
"sha512": "+GntwnyJ5tCNvUIaQxv2+ehDvZJzGUqlSB5xRBk1hTj1qqBJ6s4vK/OfGD/jae7aTmXiGSm8wpJORosNtQevJQ==",
"type": "package",
"path": "steamworks.net/20.1.0",
"files": [
".nupkg.metadata",
".signature.p7s",
"lib/netstandard2.1/Steamworks.NET.dll",
"readme.md",
"ref/netstandard2.1/Steamworks.NET.dll",
"runtimes/linux-x64/lib/netstandard2.1/Steamworks.NET.dll",
"runtimes/linux-x86/lib/netstandard2.1/Steamworks.NET.dll",
"runtimes/osx-x64/lib/netstandard2.1/Steamworks.NET.dll",
"runtimes/osx-x86/lib/netstandard2.1/Steamworks.NET.dll",
"runtimes/win-x64/lib/netstandard2.1/Steamworks.NET.dll",
"runtimes/win-x86/lib/netstandard2.1/Steamworks.NET.dll",
"steamworks.net.20.1.0.nupkg.sha512",
"steamworks.net.nuspec"
]
}
},
"projectFileDependencyGroups": {
".NETStandard,Version=v2.1": [
"GLFWDotNet >= 20.9.0",
"Microsoft.CSharp >= 4.7.0"
"Microsoft.CSharp >= 4.7.0",
"Steamworks.NET >= 20.1.0"
]
},
"packageFolders": {
@@ -181,6 +237,10 @@
"Microsoft.CSharp": {
"target": "Package",
"version": "[4.7.0, )"
},
"Steamworks.NET": {
"target": "Package",
"version": "[20.1.0, )"
}
},
"imports": [
@@ -1,11 +1,12 @@
{
"version": 2,
"dgSpecHash": "jWVPLGMPic807+4NLpG1k4UvkHQcYelA2LmqZ1AT677bAmBrCawrGC32ML8FV5TygCjZ4mzeLqdcYpsF82f61A==",
"dgSpecHash": "D2b6GMfOY4aZxUai0LnRuWyULH+CEG98xFRXi9OAg3hVh5QYpI8wa9Penb+96fBCHHpWEQ22IzA65zYWs4fy2g==",
"success": true,
"projectFilePath": "D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\源代码\\.Net\\StgSharp\\StgSharp.csproj",
"expectedPackageFiles": [
"C:\\Users\\Nitlo\\.nuget\\packages\\glfwdotnet\\20.9.0\\glfwdotnet.20.9.0.nupkg.sha512",
"C:\\Users\\Nitlo\\.nuget\\packages\\microsoft.csharp\\4.7.0\\microsoft.csharp.4.7.0.nupkg.sha512"
"C:\\Users\\Nitlo\\.nuget\\packages\\microsoft.csharp\\4.7.0\\microsoft.csharp.4.7.0.nupkg.sha512",
"C:\\Users\\Nitlo\\.nuget\\packages\\steamworks.net\\20.1.0\\steamworks.net.20.1.0.nupkg.sha512"
],
"logs": []
}