11 #include <argos3/core/utility/math/quaternion.h>
12 #include <argos3/core/utility/math/vector3.h>
20 Real fTrace = 1.0f + m_pfValues[0] + m_pfValues[4] + m_pfValues[8];
21 if (fTrace > 0.00001f) {
25 (m_pfValues[7] - m_pfValues[5]) / fS,
26 (m_pfValues[2] - m_pfValues[6]) / fS,
27 (m_pfValues[3] - m_pfValues[1]) / fS);
29 else if (m_pfValues[0] > m_pfValues[4] && m_pfValues[0] > m_pfValues[8]) {
30 Real fS =
Sqrt(1.0f + m_pfValues[0] - m_pfValues[4] - m_pfValues[8]) * 2.0f;
32 (m_pfValues[7] - m_pfValues[5]) / fS,
34 (m_pfValues[3] + m_pfValues[1]) / fS,
35 (m_pfValues[2] + m_pfValues[6]) / fS);
37 else if (m_pfValues[4] > m_pfValues[8]) {
38 Real fS =
Sqrt(1.0f + m_pfValues[4] - m_pfValues[0] - m_pfValues[8]) * 2.0f;
40 (m_pfValues[2] - m_pfValues[6]) / fS,
41 (m_pfValues[3] + m_pfValues[1]) / fS,
43 (m_pfValues[7] + m_pfValues[5]) / fS);
46 Real fS =
Sqrt(1.0f + m_pfValues[8] - m_pfValues[0] - m_pfValues[4]) * 2.0f;
48 (m_pfValues[3] - m_pfValues[1]) / fS,
49 (m_pfValues[2] + m_pfValues[6]) / fS,
50 (m_pfValues[7] + m_pfValues[5]) / fS,
81 m_pfValues[1] = (fCosZ * fSinY * fSinX) - (fCosX * fSinZ);
82 m_pfValues[2] = (fSinZ * fSinX) + (fCosZ * fCosX * fSinY);
84 m_pfValues[4] = (fCosZ * fCosX) + (fSinZ * fSinY * fSinX);
85 m_pfValues[5] = (fCosX * fSinZ * fSinY) - (fCosZ * fSinX);
float Real
Collects all ARGoS code.
The namespace containing all the ARGoS related code.
Real Cos(const CRadians &c_radians)
Computes the cosine of the passed value in radians.
Real Sin(const CRadians &c_radians)
Computes the sine of the passed value in radians.
It defines the basic type CRadians, used to store an angle value in radians.
Real m_pfValues[ROWS *COLS]
CVector3 operator*(const CVector3 &c_vector) const
void SetFromValues(Real f_value0, Real f_value1, Real f_value2, Real f_value3, Real f_value4, Real f_value5, Real f_value6, Real f_value7, Real f_value8)
void SetFromAngles(const CRadians &c_x_angle, const CRadians &c_y_angle, const CRadians &c_z_angle)
void SetFromMatrix(const CMatrix< 3, 3 > &c_matrix)