public static Quaternion ToQuaternion(this NEulerAngles e) => Quaternion.CreateFromYawPitchRoll(e.Yaw, e.Pitch, e.Roll);
static void ToEulerAngles_One(NEulerAngles expected, Vector3 rotatedUnitZ, Vector3 rotatedUnitY) { var actual = NRotationHelper.ToEulerAngles(rotatedUnitZ, rotatedUnitY); AssertNEulerAngles(expected, actual); }
public static Matrix4x4 ToMatrix4x4(this NEulerAngles e) => Matrix4x4.CreateFromYawPitchRoll(e.Yaw, e.Pitch, e.Roll);
static void AssertNEulerAngles(NEulerAngles expected, NEulerAngles actual) { Assert.IsTrue(Math.Abs(expected.Yaw - actual.Yaw) < 0.001); Assert.IsTrue(Math.Abs(expected.Pitch - actual.Pitch) < 0.001); Assert.IsTrue(Math.Abs(expected.Roll - actual.Roll) < 0.001); }