Ignore:
Timestamp:
May 5, 2012, 5:16:29 PM (10 years ago)
Author:
sam
Message:

math: allow to write 1.f / q to take a quaternion's inverse.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/quat.cpp

    r1318 r1341  
    117117        quat a(2.f, -2.f, -8.f, 3.f);
    118118        quat b = re(a);
     119        quat c = 1.f / a;
     120
     121        LOLUNIT_ASSERT_DOUBLES_EQUAL(b.w, c.w, 1e-5);
     122        LOLUNIT_ASSERT_DOUBLES_EQUAL(b.x, c.x, 1e-5);
     123        LOLUNIT_ASSERT_DOUBLES_EQUAL(b.y, c.y, 1e-5);
     124        LOLUNIT_ASSERT_DOUBLES_EQUAL(b.z, c.z, 1e-5);
    119125
    120126        quat m1 = a * b;
Note: See TracChangeset for help on using the changeset viewer.