ARGoS 3
A parallel, multi-engine simulator for swarm robotics
transformationmatrix2.cpp
Go to the documentation of this file.
1
10
11#include <argos3/core/utility/math/matrix/rotationmatrix2.h>
12#include <argos3/core/utility/math/vector2.h>
13
14namespace argos {
15
16 /****************************************/
17 /****************************************/
18
19 void CTransformationMatrix2::SetFromComponents(const CRotationMatrix2& c_rotation, const CVector2& c_translation) {
20 SetRotationMatrix(c_rotation);
21 SetTranslationVector(c_translation);
22 m_pfValues[6] = 0.0f;
23 m_pfValues[7] = 0.0f;
24 m_pfValues[8] = 1.0f;
25 }
26
27 /****************************************/
28 /****************************************/
29
31 m_pfValues[0] = c_matrix.m_pfValues[0];
32 m_pfValues[1] = c_matrix.m_pfValues[1];
33 m_pfValues[2] = c_matrix.m_pfValues[2];
34 m_pfValues[3] = c_matrix.m_pfValues[3];
35 m_pfValues[4] = c_matrix.m_pfValues[4];
36 m_pfValues[5] = c_matrix.m_pfValues[5];
37 m_pfValues[6] = c_matrix.m_pfValues[6];
38 m_pfValues[7] = c_matrix.m_pfValues[7];
39 m_pfValues[8] = c_matrix.m_pfValues[8];
40 }
41
42 /****************************************/
43 /****************************************/
44
45 void CTransformationMatrix2::SetFromValues(Real f_value0, Real f_value1, Real f_value2,
46 Real f_value3, Real f_value4, Real f_value5,
47 Real f_value6, Real f_value7, Real f_value8) {
48 m_pfValues[0] = f_value0;
49 m_pfValues[1] = f_value1;
50 m_pfValues[2] = f_value2;
51 m_pfValues[3] = f_value3;
52 m_pfValues[4] = f_value4;
53 m_pfValues[5] = f_value5;
54 m_pfValues[6] = f_value6;
55 m_pfValues[7] = f_value7;
56 m_pfValues[8] = f_value8;
57 }
58
59 /****************************************/
60 /****************************************/
61
63 m_pfValues[0] = c_rotation.m_pfValues[0]; m_pfValues[1] = c_rotation.m_pfValues[1];
64 m_pfValues[3] = c_rotation.m_pfValues[2]; m_pfValues[4] = c_rotation.m_pfValues[3];
65 }
66
67 /****************************************/
68 /****************************************/
69
74
75 /****************************************/
76 /****************************************/
77
79 m_pfValues[2] = c_translation.m_fX;
80 m_pfValues[5] = c_translation.m_fY;
81 }
82
83 /****************************************/
84 /****************************************/
85
89
90 /****************************************/
91 /****************************************/
92}
float Real
Collects all ARGoS code.
Definition datatypes.h:39
The namespace containing all the ARGoS related code.
Definition ci_actuator.h:12
friend class CRotationMatrix2
Definition matrix.h:26
Real m_pfValues[ROWS *COLS]
Definition matrix.h:222
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 SetTranslationVector(const CVector2 &c_translation)
CRotationMatrix2 GetRotationMatrix() const
void SetFromMatrix(const CMatrix< 3, 3 > &c_matrix)
void SetFromComponents(const CRotationMatrix2 &c_rotation, const CVector2 &c_translation)
void SetRotationMatrix(const CRotationMatrix2 &c_rotation)
A 2D vector class.
Definition vector2.h:27