Files
TCPlayerbotCore/dep/include/g3dlite/G3D/Quat.inl
T
Neo2003 9b1c0e006f [svn] * Proper SVN structure
--HG--
branch : trunk
2008-10-02 16:23:55 -05:00

39 lines
774 B
C++

/**
Quat.inl
@cite Quaternion implementation based on Watt & Watt page 363.
Thanks to Max McGuire for slerp optimizations.
@maintainer Morgan McGuire, [email protected]
@created 2002-01-23
@edited 2004-03-04
*/
namespace G3D {
inline float& Quat::operator[] (int i) {
debugAssert(i >= 0);
debugAssert(i < 4);
return ((float*)this)[i];
}
inline const float& Quat::operator[] (int i) const {
debugAssert(i >= 0);
debugAssert(i < 4);
return ((float*)this)[i];
}
inline Quat Quat::operator-(const Quat& other) const {
return Quat(x - other.x, y - other.y, z - other.z, w - other.w);
}
inline Quat Quat::operator+(const Quat& other) const {
return Quat(x + other.x, y + other.y, z + other.z, w + other.w);
}
}