Changeset 1317


Ignore:
Timestamp:
Apr 30, 2012, 3:40:51 PM (10 years ago)
Author:
sam
Message:

math: add Quat::transform() to directly apply a quaternion to a vector.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lol/math/vector.h

    r1315 r1317  
    948948    }
    949949
     950    inline Vec3<T> transform(Vec3<T> const &v)
     951    {
     952        Quat<T> p = Quat<T>(0, v.x, v.y, v.z);
     953        Quat<T> q = *this * p / *this;
     954        return Vec3<T>(q.x, q.y, q.z);
     955    }
     956
    950957#if !defined __ANDROID__
    951958    template<typename U>
Note: See TracChangeset for help on using the changeset viewer.