goat3d
diff libs/vmath/quat.inl @ 28:9ba3e2fb8a33
modified vmath to work with vs2012, still memory corruptions in 3dsmax...
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 29 Sep 2013 08:46:19 +0300 |
parents | 4deb0b12fe14 |
children |
line diff
1.1 --- a/libs/vmath/quat.inl Sun Sep 29 08:20:19 2013 +0300 1.2 +++ b/libs/vmath/quat.inl Sun Sep 29 08:46:19 2013 +0300 1.3 @@ -23,7 +23,7 @@ 1.4 extern "C" { 1.5 #endif /* __cplusplus */ 1.6 1.7 -static inline quat_t quat_mul(quat_t q1, quat_t q2) 1.8 +static VMATH_INLINE quat_t quat_mul(quat_t q1, quat_t q2) 1.9 { 1.10 quat_t res; 1.11 vec3_t v1 = quat_vec(q1); 1.12 @@ -37,7 +37,7 @@ 1.13 return res; 1.14 } 1.15 1.16 -static inline quat_t quat_conjugate(quat_t q) 1.17 +static VMATH_INLINE quat_t quat_conjugate(quat_t q) 1.18 { 1.19 q.x = -q.x; 1.20 q.y = -q.y; 1.21 @@ -45,7 +45,7 @@ 1.22 return q; 1.23 } 1.24 1.25 -static inline quat_t quat_inverse(quat_t q) 1.26 +static VMATH_INLINE quat_t quat_inverse(quat_t q) 1.27 { 1.28 scalar_t lensq = quat_length_sq(q); 1.29 q = quat_conjugate(q); 1.30 @@ -56,14 +56,14 @@ 1.31 return q; 1.32 } 1.33 1.34 -static inline void quat_to_mat3(mat3_t res, quat_t q) 1.35 +static VMATH_INLINE void quat_to_mat3(mat3_t res, quat_t q) 1.36 { 1.37 m3_cons(res, 1.0 - 2.0 * q.y*q.y - 2.0 * q.z*q.z, 2.0 * q.x * q.y - 2.0 * q.w * q.z, 2.0 * q.z * q.x + 2.0 * q.w * q.y, 1.38 2.0 * q.x * q.y + 2.0 * q.w * q.z, 1.0 - 2.0 * q.x*q.x - 2.0 * q.z*q.z, 2.0 * q.y * q.z - 2.0 * q.w * q.x, 1.39 2.0 * q.z * q.x - 2.0 * q.w * q.y, 2.0 * q.y * q.z + 2.0 * q.w * q.x, 1.0 - 2.0 * q.x*q.x - 2.0 * q.y*q.y); 1.40 } 1.41 1.42 -static inline void quat_to_mat4(mat4_t res, quat_t q) 1.43 +static VMATH_INLINE void quat_to_mat4(mat4_t res, quat_t q) 1.44 { 1.45 m4_cons(res, 1.0 - 2.0 * q.y*q.y - 2.0 * q.z*q.z, 2.0 * q.x * q.y - 2.0 * q.w * q.z, 2.0 * q.z * q.x + 2.0 * q.w * q.y, 0, 1.46 2.0 * q.x * q.y + 2.0 * q.w * q.z, 1.0 - 2.0 * q.x*q.x - 2.0 * q.z*q.z, 2.0 * q.y * q.z - 2.0 * q.w * q.x, 0, 1.47 @@ -74,7 +74,7 @@ 1.48 #ifdef __cplusplus 1.49 } /* extern "C" */ 1.50 1.51 -inline Quaternion lerp(const Quaternion &a, const Quaternion &b, scalar_t t) 1.52 +VMATH_INLINE Quaternion lerp(const Quaternion &a, const Quaternion &b, scalar_t t) 1.53 { 1.54 return slerp(a, b, t); 1.55 }