diff --git a/src/array.h b/src/array.h index 5b23fa36..873116c5 100644 --- a/src/array.h +++ b/src/array.h @@ -270,7 +270,7 @@ public: { T1 tmp1 = m1; T2 tmp2 = m2; T3 tmp3 = m3; T4 tmp4 = m4; T5 tmp5 = m5; T6 tmp6 = m6; T7 tmp7 = m7; T8 tmp8 = m8; - Reserve(this->m_count * 13 / 8 + 8); + this->Reserve(this->m_count * 13 / 8 + 8); this->m_data[this->m_count].m1 = tmp1; this->m_data[this->m_count].m2 = tmp2; this->m_data[this->m_count].m3 = tmp3; @@ -309,7 +309,7 @@ public: { T1 tmp1 = m1; T2 tmp2 = m2; T3 tmp3 = m3; T4 tmp4 = m4; T5 tmp5 = m5; T6 tmp6 = m6; T7 tmp7 = m7; - Reserve(this->m_count * 13 / 8 + 8); + this->Reserve(this->m_count * 13 / 8 + 8); this->m_data[this->m_count].m1 = tmp1; this->m_data[this->m_count].m2 = tmp2; this->m_data[this->m_count].m3 = tmp3; @@ -346,7 +346,7 @@ public: { T1 tmp1 = m1; T2 tmp2 = m2; T3 tmp3 = m3; T4 tmp4 = m4; T5 tmp5 = m5; T6 tmp6 = m6; - Reserve(this->m_count * 13 / 8 + 8); + this->Reserve(this->m_count * 13 / 8 + 8); this->m_data[this->m_count].m1 = tmp1; this->m_data[this->m_count].m2 = tmp2; this->m_data[this->m_count].m3 = tmp3; @@ -380,7 +380,7 @@ public: { T1 tmp1 = m1; T2 tmp2 = m2; T3 tmp3 = m3; T4 tmp4 = m4; T5 tmp5 = m5; - Reserve(this->m_count * 13 / 8 + 8); + this->Reserve(this->m_count * 13 / 8 + 8); this->m_data[this->m_count].m1 = tmp1; this->m_data[this->m_count].m2 = tmp2; this->m_data[this->m_count].m3 = tmp3; @@ -410,7 +410,7 @@ public: if (this->m_count >= this->m_reserved) { T1 tmp1 = m1; T2 tmp2 = m2; T3 tmp3 = m3; T4 tmp4 = m4; - Reserve(this->m_count * 13 / 8 + 8); + this->Reserve(this->m_count * 13 / 8 + 8); this->m_data[this->m_count].m1 = tmp1; this->m_data[this->m_count].m2 = tmp2; this->m_data[this->m_count].m3 = tmp3; @@ -438,7 +438,7 @@ public: if (this->m_count >= this->m_reserved) { T1 tmp1 = m1; T2 tmp2 = m2; T3 tmp3 = m3; - Reserve(this->m_count * 13 / 8 + 8); + this->Reserve(this->m_count * 13 / 8 + 8); this->m_data[this->m_count].m1 = tmp1; this->m_data[this->m_count].m2 = tmp2; this->m_data[this->m_count].m3 = tmp3; @@ -464,7 +464,7 @@ public: if (this->m_count >= this->m_reserved) { T1 tmp1 = m1; T2 tmp2 = m2; - Reserve(this->m_count * 13 / 8 + 8); + this->Reserve(this->m_count * 13 / 8 + 8); this->m_data[this->m_count].m1 = tmp1; this->m_data[this->m_count].m2 = tmp2; } diff --git a/src/lol/math/real.h b/src/lol/math/real.h index 339db257..63819b1e 100644 --- a/src/lol/math/real.h +++ b/src/lol/math/real.h @@ -276,6 +276,28 @@ template<> real fmod(real const &x, real const &y); template<> void real::hexprint() const; template<> void real::print(int ndigits) const; +template<> real const real::R_0; +template<> real const real::R_1; +template<> real const real::R_2; +template<> real const real::R_3; +template<> real const real::R_10; + +template<> real const real::R_LN2; +template<> real const real::R_LN10; +template<> real const real::R_LOG2E; +template<> real const real::R_LOG10E; +template<> real const real::R_E; +template<> real const real::R_PI; +template<> real const real::R_PI_2; +template<> real const real::R_PI_3; +template<> real const real::R_PI_4; +template<> real const real::R_1_PI; +template<> real const real::R_2_PI; +template<> real const real::R_2_SQRTPI; +template<> real const real::R_SQRT2; +template<> real const real::R_SQRT3; +template<> real const real::R_SQRT1_2; + } /* namespace lol */ #endif // __LOL_MATH_REAL_H__ diff --git a/src/lol/math/vector.h b/src/lol/math/vector.h index 71c2190a..5dfb4ce9 100644 --- a/src/lol/math/vector.h +++ b/src/lol/math/vector.h @@ -964,14 +964,7 @@ template struct Quat static Quat fromeuler_zxy(T phi, T theta, T psi); static Quat fromeuler_zyx(T phi, T theta, T psi); - inline Quat operator *(Quat const &val) const - { - Quat ret; - Vec3 v1(x, y, z); - Vec3 v2(val.x, val.y, val.z); - Vec3 v3 = cross(v1, v2) + w * v2 + val.w * v1; - return Quat(w * val.w - dot(v1, v2), v3.x, v3.y, v3.z); - } + inline Quat operator *(Quat const &val) const; inline Quat operator *=(Quat const &val) { @@ -1522,6 +1515,20 @@ ACTIVATE_COERCE_NAMESPACES(real) #undef DECLARE_ALL_VECTOR_OPS_INNER #undef DECLARE_ALL_VECTOR_OPS +/* + * Definition of additional functions requiring vector functions + */ + +template +inline Quat Quat::operator *(Quat const &val) const +{ + Quat ret; + Vec3 v1(x, y, z); + Vec3 v2(val.x, val.y, val.z); + Vec3 v3 = cross(v1, v2) + w * v2 + val.w * v1; + return Quat(w * val.w - dot(v1, v2), v3.x, v3.y, v3.z); +} + /* * Magic vector swizzling (part 2/2) * Unfortunately these assignment operators cannot be used for now, because