ARGoS  3
A parallel, multi-engine simulator for swarm robotics
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 }
argos
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
argos::CVector3
A 3D vector class.
Definition: vector3.h:29
argos::CVector3::X
static const CVector3 X
The x axis.
Definition: vector3.h:34
argos::CQuaternion::Inverse
CQuaternion Inverse() const
Definition: quaternion.h:97
argos::CVector3::Z
static const CVector3 Z
The z axis.
Definition: vector3.h:40
vector3.h
argos::CQuaternion::GetY
Real GetY() const
Definition: quaternion.h:56
argos::CVector3::Y
static const CVector3 Y
The y axis.
Definition: vector3.h:37
argos::CQuaternion::GetZ
Real GetZ() const
Definition: quaternion.h:60
argos::CQuaternion
Definition: quaternion.h:14
argos::CQuaternion::GetX
Real GetX() const
Definition: quaternion.h:52
argos::CVector3::ZERO
static const CVector3 ZERO
The zero vector (0,0,0)
Definition: vector3.h:43
argos::CVector3::Rotate
CVector3 & Rotate(const CQuaternion &c_quaternion)
Rotates this vector by the given quaternion.
Definition: vector3.cpp:25
quaternion.h