From f030154fe727e25a2afe1f78b3998c2d2dba95e4 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 18 Aug 2009 09:24:15 +0000 Subject: astyle cleanup, corrects not loading of material textures --- src/math/axis.cc | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/math/axis.cc') 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]; -- cgit v1.2.3