public void Create() { var euler = new EulerAngles(1, 2, 3); Assert.AreEqual(euler.Pitch, 1); Assert.AreEqual(euler.Yaw, 2); Assert.AreEqual(euler.Roll, 3); }
public void GetHashCodeViaDictionary() { var first = new EulerAngles(1, 2, 3); var second = new EulerAngles(3, 4, 5); var eulerAngles = new Dictionary<EulerAngles, int> { { first, 1 }, { second, 2 } }; Assert.IsTrue(eulerAngles.ContainsKey(first)); Assert.IsTrue(eulerAngles.ContainsKey(second)); Assert.IsFalse(eulerAngles.ContainsKey(new EulerAngles(5, 6, 7))); }
public void Equals() { var euler1 = new EulerAngles(1, 2, 3); var euler2 = new EulerAngles(3, 4, 5); Assert.AreNotEqual(euler1, euler2); Assert.AreEqual(euler1, new EulerAngles(1, 2, 3)); Assert.IsTrue(euler1 == new EulerAngles(1, 2, 3)); Assert.IsTrue(euler1 != euler2); Assert.IsTrue(euler1.Equals((object)new EulerAngles(1, 2, 3))); }
public bool Equals(EulerAngles other) { return Pitch.IsNearlyEqual(other.Pitch) && Yaw.IsNearlyEqual(other.Yaw) && Roll.IsNearlyEqual(other.Roll); }
public static Matrix CreateRotationZYX(EulerAngles eulerAngles) { return(CreateRotationZYX(eulerAngles.Pitch, eulerAngles.Yaw, eulerAngles.Roll)); }
private static void VerifyEuler(EulerAngles eulerAngles) { var rotationMatrix = Matrix.CreateRotationZYX(eulerAngles); var rotationQuaternion = Quaternion.FromRotationMatrix(rotationMatrix); Assert.AreEqual(eulerAngles, rotationQuaternion.ToEuler()); }
public bool Equals(EulerAngles other) { return(Pitch.IsNearlyEqual(other.Pitch) && Yaw.IsNearlyEqual(other.Yaw) && Roll.IsNearlyEqual(other.Roll)); }