Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2009-08-18 09:24:15 +0000
committerStijn Buys <ingar@osirion.org>2009-08-18 09:24:15 +0000
commitf030154fe727e25a2afe1f78b3998c2d2dba95e4 (patch)
treecd92baf9e4fa8a136523b9eb570e9811846c9250 /src/math/axis.cc
parent5636fad174f0bcff857c357c394c4cc8d424b302 (diff)
astyle cleanup, corrects not loading of material textures
Diffstat (limited to 'src/math/axis.cc')
-rw-r--r--src/math/axis.cc26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/math/axis.cc b/src/math/axis.cc
index 31ba26a..402b2f6 100644
--- a/src/math/axis.cc
+++ b/src/math/axis.cc
@@ -30,7 +30,7 @@ void Axis::clear()
void Axis::assign(const Axis & other)
{
- for (size_t i=0; i < 3; i++) {
+ for (size_t i = 0; i < 3; i++) {
axis_vector[i].assign(other.axis_vector[i]);
}
}
@@ -46,10 +46,10 @@ void Axis::change_direction(const float angle)
{
float cosa = cosf(angle * M_PI / 180.0f);
float sina = sinf(angle * M_PI / 180.0f);
-
+
Vector3f forward = axis_vector[0] * cosa + axis_vector[1] * sina;
- Vector3f left = axis_vector[1] *cosa - axis_vector[0] * sina;
-
+ Vector3f left = axis_vector[1] * cosa - axis_vector[0] * sina;
+
axis_vector[0].assign(forward);
axis_vector[1].assign(left);
}
@@ -59,10 +59,10 @@ void Axis::change_pitch(const float angle)
{
float cosa = cosf(angle * M_PI / 180.0f);
float sina = sinf(angle * M_PI / 180.0f);
-
+
Vector3f forward = axis_vector[0] * cosa + axis_vector[2] * sina;
Vector3f up = axis_vector[2] * cosa - axis_vector[0] * sina;
-
+
axis_vector[0].assign(forward);
axis_vector[2].assign(up);
}
@@ -72,10 +72,10 @@ void Axis::change_roll(const float angle)
{
float cosa = cosf(angle * M_PI / 180.0f);
float sina = sinf(angle * M_PI / 180.0f);
-
+
Vector3f forward = axis_vector[2] * cosa + axis_vector[1] * sina;
Vector3f up = axis_vector[1] * cosa - axis_vector[2] * sina;
-
+
axis_vector[2].assign(forward);
axis_vector[1].assign(up);
}
@@ -88,19 +88,19 @@ void Axis::rotate(Vector3f const &normal, float angle)
{
float cosa = cosf(angle);
float sina = sinf(angle);
-
- for (size_t i =0; i < 3; i++) {
+
+ for (size_t i = 0; i < 3; i++) {
axis_vector[i] =
- axis_vector[i]*cosa +
+ axis_vector[i] * cosa +
normal * dotproduct(normal, axis_vector[i]) * (1 - cosa) +
- crossproduct(axis_vector[i], normal)*sina;
+ crossproduct(axis_vector[i], normal) * sina;
}
}
const Axis Axis::transpose() const
{
Axis t;
-
+
for (size_t i = 0; i < 3; i++)
for (size_t j = 0; j < 3; j++)
t.axis_vector[i][j] = axis_vector[j][i];