Loading libs/math/include/math/quat.h +9 −14 Original line number Diff line number Diff line Loading @@ -24,19 +24,15 @@ #include <stdint.h> #include <sys/types.h> #ifndef PURE #define PURE __attribute__((pure)) #endif #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgnu-anonymous-struct" #pragma clang diagnostic ignored "-Wnested-anon-types" namespace android { // ------------------------------------------------------------------------------------- namespace details { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgnu-anonymous-struct" #pragma clang diagnostic ignored "-Wnested-anon-types" template <typename T> class TQuaternion : public TVecAddOperators<TQuaternion, T>, public TVecUnaryOperators<TQuaternion, T>, Loading Loading @@ -130,11 +126,14 @@ public: // constructs a quaternion from an axis and angle template <typename A, typename B> constexpr static TQuaternion PURE fromAxisAngle(const TVec3<A>& axis, B angle) { constexpr static TQuaternion __attribute__((pure)) fromAxisAngle(const TVec3<A>& axis, B angle) { return TQuaternion(std::sin(angle * 0.5) * normalize(axis), std::cos(angle * 0.5)); } }; #pragma clang diagnostic pop } // namespace details // ---------------------------------------------------------------------------------------- Loading Loading @@ -188,7 +187,3 @@ constexpr inline quatd operator""_kd(unsigned long long v) { // NOLINT } // namespace android TVECHELPERS_STD_HASH(android::details::TQuaternion); #pragma clang diagnostic pop #undef PURE Loading
libs/math/include/math/quat.h +9 −14 Original line number Diff line number Diff line Loading @@ -24,19 +24,15 @@ #include <stdint.h> #include <sys/types.h> #ifndef PURE #define PURE __attribute__((pure)) #endif #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgnu-anonymous-struct" #pragma clang diagnostic ignored "-Wnested-anon-types" namespace android { // ------------------------------------------------------------------------------------- namespace details { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgnu-anonymous-struct" #pragma clang diagnostic ignored "-Wnested-anon-types" template <typename T> class TQuaternion : public TVecAddOperators<TQuaternion, T>, public TVecUnaryOperators<TQuaternion, T>, Loading Loading @@ -130,11 +126,14 @@ public: // constructs a quaternion from an axis and angle template <typename A, typename B> constexpr static TQuaternion PURE fromAxisAngle(const TVec3<A>& axis, B angle) { constexpr static TQuaternion __attribute__((pure)) fromAxisAngle(const TVec3<A>& axis, B angle) { return TQuaternion(std::sin(angle * 0.5) * normalize(axis), std::cos(angle * 0.5)); } }; #pragma clang diagnostic pop } // namespace details // ---------------------------------------------------------------------------------------- Loading Loading @@ -188,7 +187,3 @@ constexpr inline quatd operator""_kd(unsigned long long v) { // NOLINT } // namespace android TVECHELPERS_STD_HASH(android::details::TQuaternion); #pragma clang diagnostic pop #undef PURE