Core/Movement: Add time synchronisation (Needs tested)
Port From (https://github.com/TrinityCore/TrinityCore/commit/c19a4db1c12b8864d6c486ee8e2f0e058fb4155a)
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
using Framework.Constants;
|
||||
using Framework.GameMath;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
|
||||
public static class MathFunctions
|
||||
@@ -269,6 +270,22 @@ public static class MathFunctions
|
||||
return (ushort)((byte)l | (ushort)h << 8);
|
||||
}
|
||||
|
||||
public static double Variance(this IEnumerable<uint> source)
|
||||
{
|
||||
int n = 0;
|
||||
double mean = 0;
|
||||
double M2 = 0;
|
||||
|
||||
foreach (var x in source)
|
||||
{
|
||||
n = n + 1;
|
||||
double delta = x - mean;
|
||||
mean = mean + delta / n;
|
||||
M2 += delta * (x - mean);
|
||||
}
|
||||
return M2 / (n - 1);
|
||||
}
|
||||
|
||||
//3d math
|
||||
public static Box toWorldSpace(Matrix4x4 rotation, Vector3 translation, Box box)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user