start work for live radar
This commit is contained in:
@ -4,6 +4,7 @@ using Microsoft.EntityFrameworkCore.Query.Internal;
|
||||
using Microsoft.EntityFrameworkCore.Storage;
|
||||
#endif
|
||||
using SharedLibraryCore.Database.Models;
|
||||
using SharedLibraryCore.Helpers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
@ -812,6 +813,27 @@ namespace SharedLibraryCore
|
||||
return Regex.IsMatch(message, @"^\u0014(?:[A-Z]|_)+$");
|
||||
}
|
||||
|
||||
public static Vector3 FixIW4Angles(this Vector3 vector)
|
||||
{
|
||||
float X = vector.X >= 0 ? vector.X : 360.0f + vector.X;
|
||||
float Y = vector.Y >= 0 ? vector.Y : 360.0f + vector.Y;
|
||||
float Z = vector.Z >= 0 ? vector.Z : 360.0f + vector.Z;
|
||||
|
||||
return new Vector3(Y, X, Z);
|
||||
}
|
||||
|
||||
public static float ToRadians(this float value) => (float)Math.PI * value / 180.0f;
|
||||
|
||||
public static float ToDegrees(this float value) => value * 180.0f / (float)Math.PI;
|
||||
|
||||
public static double[] AngleStuff(Vector3 a, Vector3 b)
|
||||
{
|
||||
double deltaX = 180.0 - Math.Abs(Math.Abs(a.X - b.X) - 180.0);
|
||||
double deltaY = 180.0 - Math.Abs(Math.Abs(a.Y - b.Y) - 180.0);
|
||||
|
||||
return new[] { deltaX, deltaY };
|
||||
}
|
||||
|
||||
#if DEBUG == true
|
||||
|
||||
private static readonly TypeInfo QueryCompilerTypeInfo = typeof(QueryCompiler).GetTypeInfo();
|
||||
|
Reference in New Issue
Block a user