blob: 7bd52629e28b0803a41a2c150cd0c1ab46446100 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
/*
math/axis.cc
This file is part of the Osirion project and is distributed under
the terms of the GNU General Public License version 2
*/
// project headers
#include "math/axis.h"
namespace math
{
Axis::Axis()
{
clear();
}
Axis::Axis(const Axis & other) {
assign(other);
}
void Axis::clear()
{
axis_vector[0] = Vector3f(1.0f, 0.0f, 0.0f);
axis_vector[1] = Vector3f(0.0f, 1.0f, 0.0f);
axis_vector[2] = Vector3f(0.0f, 0.0f, 1.0f);
}
void Axis::assign(const Axis & other) {
for (size_t i=0; i < 3; i++) {
axis_vector[i].assign(other.axis_vector[i]);
}
}
Axis & Axis::operator=(const Axis & other) {
assign(other);
return *this;
}
// alter heading, rotate around Z-axis (positive is left)
void Axis::direction(const float angle) {
for (size_t i=0; i < 3; i++) {
//axis_vector[i].rotate(axis_vector[2], angle);
}
}
// alter heading, rotate around negative Y-axis (positive is up)
void Axis::pitch(const float pitch) {
for (size_t i=0; i < 3; i++) {
//axis_vector[i].rotate(axis_vector[1], -angle);
}
}
}
|