Math classes inling optimizations

This commit is contained in:
2026-06-14 01:49:24 +02:00
parent 7b458c4ec8
commit 704ecea09c
6 changed files with 91 additions and 81 deletions

View File

@@ -3,7 +3,7 @@ using System.Globalization;
namespace _2DGAMELIB
{
public static class Qua
public static class Quaternion
{
public static QuaternionD RotationZQ(this double angle)
{
@@ -29,14 +29,13 @@ namespace _2DGAMELIB
public static Vector2D TransformCoordinateBP(this Vector2D coord, Vector2D BasePoint, QuaternionD rotation)
{
Vec.Subtract(ref coord, ref BasePoint, out coord);
VectorMath.Subtract(ref coord, ref BasePoint, out coord);
TransformCoordinate(ref coord, ref rotation, out var result);
Vec.Add(ref result, ref BasePoint, out result);
VectorMath.Add(ref result, ref BasePoint, out result);
return result;
}
}
//used in a total of 1 places
[Serializable]
public struct QuaternionD