daily update on 20240513 by nitload youmu, instancing render added

This commit is contained in:
YoumuLiu
2024-05-13 03:39:54 +08:00
parent 56459deec5
commit a3506c96a3
78 changed files with 2562 additions and 1098 deletions
+14 -14
View File
@@ -44,13 +44,7 @@ namespace StgSharp.Math
public static unsafe partial class Scaler
{
internal static float currentSeed
#if DEBUG
= 0.5f;
#else
= Abs(System.DateTime.UtcNow.GetHashCode());
#endif
private static byte[] randomSeed;
/// <summary>
/// returns a random float number between 0 and 1.
@@ -82,8 +76,6 @@ namespace StgSharp.Math
}
private static byte[] randomSeed;
/// <summary>
///
/// </summary>
@@ -94,13 +86,13 @@ namespace StgSharp.Math
,INumber
#endif
{
if (randomSeed==null)
if (randomSeed == null)
{
randomSeed = new byte[64];
var originSeed =
$"{(Assembly.GetEntryAssembly()==null? Assembly.GetAssembly(typeof(StgSharp))!:
Assembly.GetEntryAssembly())}" +
$"{DateTime.UtcNow.ToString("o")}";
string originSeed =
($"{((Assembly.GetEntryAssembly() == null) ? (Assembly.GetAssembly(typeof(StgSharp))!) :
Assembly.GetEntryAssembly())}") +
($"{DateTime.UtcNow.ToString("o")}");
using (SHA256 sha = SHA256.Create())
{
randomSeed = sha.ComputeHash(Encoding.UTF8.GetBytes(originSeed));
@@ -131,5 +123,13 @@ namespace StgSharp.Math
return *(int*)&seedValue;
}
internal static float currentSeed
#if DEBUG
= 0.5f;
#else
= Abs(System.DateTime.UtcNow.GetHashCode());
#endif
}
}