vector3.cpp
Go to the documentation of this file.
1 
9 #include "vector3.h"
10 #include "quaternion.h"
11 
12 namespace argos {
13 
14  /****************************************/
15  /****************************************/
16 
17  const CVector3 CVector3::X(1.0, 0.0, 0.0);
18  const CVector3 CVector3::Y(0.0, 1.0, 0.0);
19  const CVector3 CVector3::Z(0.0, 0.0, 1.0);
20  const CVector3 CVector3::ZERO;
21 
22  /****************************************/
23  /****************************************/
24 
25  CVector3& CVector3::Rotate(const CQuaternion& c_quaternion) {
26  CQuaternion cResult;
27  cResult = c_quaternion;
28  cResult *= CQuaternion(0.0f, m_fX, m_fY, m_fZ);
29  cResult *= c_quaternion.Inverse();
30  m_fX = cResult.GetX();
31  m_fY = cResult.GetY();
32  m_fZ = cResult.GetZ();
33  return *this;
34  }
35 
36  /****************************************/
37  /****************************************/
38 
39 }
A 3D vector class.
Definition: vector3.h:29
Real GetX() const
Definition: quaternion.h:53
static const CVector3 X
The x axis.
Definition: vector3.h:34
CVector3 & Rotate(const CQuaternion &c_quaternion)
Rotates this vector by the given quaternion.
Definition: vector3.cpp:25
Real GetZ() const
Definition: quaternion.h:61
CQuaternion Inverse() const
Definition: quaternion.h:98
static const CVector3 ZERO
The zero vector (0,0,0)
Definition: vector3.h:43
static const CVector3 Z
The z axis.
Definition: vector3.h:40
static const CVector3 Y
The y axis.
Definition: vector3.h:37
Real GetY() const
Definition: quaternion.h:57
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12