Abacus.SinglePrecision.Matrix44Tests.TestStaticFn_CreateFromQuaternion_iii C# (CSharp) Méthode

TestStaticFn_CreateFromQuaternion_iii() private méthode

private TestStaticFn_CreateFromQuaternion_iii ( ) : void
Résultat void
        public void TestStaticFn_CreateFromQuaternion_iii ()
        {
            for (Int32 i = 0; i < 100; ++i)
            {
                Quaternion q = QuaternionTests.GetNextRandomQuaternion();
                Quaternion.Normalise(ref q, out q);

                Matrix44 m;
                Matrix44.CreateFromQuaternion(ref q, out m);

                Quaternion q2;
                Quaternion.CreateFromRotationMatrix(ref m, out q2);

                // TODO: Investigate.  This is odd, for a few tests this
                // would fail, until it was changed to allow for negated
                // quaternions.  I'm not sure if it makes sense or not, but,
                // I have compared with XNA, and Abacus is producing the
                // same results.  So, until I find out more, I'll assume
                // that XNA behaves correctly and the comparing to a negated
                // version of the expected quaternion is acceptable.
                // PS: If anyone knows more, I'm keen to hear from you.
                QuaternionTests.AssertEqualOrNegatedWithinReason (q, q2);
            }
        }
Matrix44Tests