Ejemplo n.º 1
0
        public void TestCalculateEulerAngleRotationWithInvalidValues()
        {
            // initialised mock values
            double[][] mockEulerAngles = new double[1][] {
                new double[3] {
                    0.0,
                    1.63066957624119,
                    -3.05544587755646
                }
            };
            Quaternion mockRotation   = Quaternion.Euler(new Vector3(0.0f, 0.0f, 0.0f));
            Quaternion actualRotation = Utilities.CalculateEulerAngleRotation(mockEulerAngles, mockRotation);

            Quaternion expectedRotation = mockRotation;

            Assert.AreNotEqual(expectedRotation, actualRotation);
        }
Ejemplo n.º 2
0
        public void TestCalculateEulerAngleRotationWithValidValues()
        {
            // initialised mock values
            double[][] mockEulerAngles = new double[1][] {
                new double[3] {
                    -0.0990780677802371, 1.63066957624119, -3.05544587755646
                }
            };
            Quaternion mockRotation   = Quaternion.Euler(new Vector3(0.0f, 0.0f, 0.0f));
            Quaternion actualRotation = Utilities.CalculateEulerAngleRotation(mockEulerAngles, mockRotation);

            Quaternion expectedRotation = new Quaternion(
                0.724925816f,
                -0.685700655f,
                -0.0652272254f,
                -0.00652711652f
                );

            Assert.AreEqual(expectedRotation, actualRotation);
        }