65 : m_Minimum(DBL_MAX, DBL_MAX)
66 , m_Maximum(-DBL_MAX, -DBL_MAX)
99 kt_double fSqrLength = m_Values[0] * m_Values[0] + m_Values[1] * m_Values[1] + m_Values[2] * m_Values[2];
100 if ( fSqrLength > 0.0 )
102 rAngle = 2.0 * acos(m_Values[3]);
103 kt_double fInvLength = 1.0 / sqrt(fSqrLength);
104 rAxis.
SetX(m_Values[0] * fInvLength);
105 rAxis.
SetY(m_Values[1] * fInvLength);
106 rAxis.
SetZ(m_Values[2] * fInvLength);
128 kt_double halfAngle = 0.5*angleInRadians;
134 m_Values[0] = inverseLength * sinHalfAngle * rAxis.
GetX();
135 m_Values[1] = inverseLength * sinHalfAngle * rAxis.
GetY();
136 m_Values[2] = inverseLength * sinHalfAngle * rAxis.
GetZ();
137 m_Values[3] = cosHalfAngle;
142 kt_double test = m_Values[0] * m_Values[1] + m_Values[2] * m_Values[3];
147 rYaw = 2 * atan2(m_Values[0], m_Values[3]);;
151 else if (test < -0.499)
154 rYaw = -2 * atan2(m_Values[0], m_Values[3]);
160 kt_double sqx = m_Values[0] * m_Values[0];
161 kt_double sqy = m_Values[1] * m_Values[1];
162 kt_double sqz = m_Values[2] * m_Values[2];
164 rYaw = atan2(2 * m_Values[1] * m_Values[3] - 2 * m_Values[0] * m_Values[2], 1 - 2 * sqy - 2 * sqz);
165 rPitch = asin(2 * test);
166 rRoll = atan2(2 * m_Values[0] * m_Values[3] - 2 * m_Values[1] * m_Values[2], 1 - 2 * sqx - 2 * sqz);
186 m_Values[0] = sYaw * sPitch * cRoll + cYaw * cPitch * sRoll;
187 m_Values[1] = sYaw * cPitch * cRoll + cYaw * sPitch * sRoll;
188 m_Values[2] = cYaw * sPitch * cRoll - sYaw * cPitch * sRoll;
189 m_Values[3] = cYaw * cPitch * cRoll - sYaw * sPitch * sRoll;
void ToAngleAxis(kt_double &rAngle, karto::Vector3d &rAxis) const
void Append(const String &rString)
void FromEulerAngles(kt_double yaw, kt_double pitch, kt_double roll)
const String ToString() const
void FromAngleAxis(kt_double angleInRadians, const karto::Vector3d &rAxis)
TFSIMD_FORCE_INLINE tfScalar angle(const Quaternion &q1, const Quaternion &q2)
static String ToString(const char *value)
const kt_double KT_TOLERANCE
const Vector2d & GetPosition() const
const Quaternion & GetOrientation() const
void ToEulerAngles(kt_double &rYaw, kt_double &rPitch, kt_double &rRoll) const