From 2d8c15e0cb73e8fdee3b991bc01a5eb289ea74a3 Mon Sep 17 00:00:00 2001 From: Jeffrey Ventrella Date: Tue, 7 May 2013 18:32:56 -0700 Subject: [PATCH] cleaned up some spacing issues in Orientarion class --- libraries/avatars/src/Orientation.cpp | 46 +++++++++++++-------------- libraries/avatars/src/Orientation.h | 34 ++++++++++---------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/libraries/avatars/src/Orientation.cpp b/libraries/avatars/src/Orientation.cpp index fddb64d700..ac47dd3f6e 100755 --- a/libraries/avatars/src/Orientation.cpp +++ b/libraries/avatars/src/Orientation.cpp @@ -20,25 +20,25 @@ Orientation::Orientation() { void Orientation::setToIdentity() { quat = glm::quat(); - right = glm::vec3( IDENTITY_RIGHT ); - up = glm::vec3( IDENTITY_UP ); - front = glm::vec3( IDENTITY_FRONT ); + right = glm::vec3(IDENTITY_RIGHT); + up = glm::vec3(IDENTITY_UP ); + front = glm::vec3(IDENTITY_FRONT); } -void Orientation::set( Orientation o ) { +void Orientation::set(Orientation o) { - quat = o.quat; - right = o.right; - up = o.up; - front = o.front; + quat = o.quat; + right = o.right; + up = o.up; + front = o.front; } -void Orientation::yaw( float angle ) { +void Orientation::yaw(float angle) { float radian = angle * PI_OVER_180; - if ( USING_QUATERNIONS ) { - rotateAndGenerateDirections( glm::quat( glm::vec3( 0.0f, -radian, 0.0f )) ); + if (USING_QUATERNIONS) { + rotateAndGenerateDirections(glm::quat(glm::vec3(0.0f, -radian, 0.0f))); } else { float s = sin(radian); float c = cos(radian); @@ -53,12 +53,12 @@ void Orientation::yaw( float angle ) { } } -void Orientation::pitch( float angle ) { +void Orientation::pitch(float angle) { float radian = angle * PI_OVER_180; - if ( USING_QUATERNIONS ) { - rotateAndGenerateDirections( glm::quat( glm::vec3( radian, 0.0f, 0.0f ) ) ); + if (USING_QUATERNIONS) { + rotateAndGenerateDirections(glm::quat(glm::vec3(radian, 0.0f, 0.0f))); } else { float s = sin(radian); float c = cos(radian); @@ -73,12 +73,12 @@ void Orientation::pitch( float angle ) { } } -void Orientation::roll( float angle ) { +void Orientation::roll(float angle) { float radian = angle * PI_OVER_180; - if ( USING_QUATERNIONS ) { - rotateAndGenerateDirections( glm::quat( glm::vec3( 0.0f, 0.0f, radian )) ); + if (USING_QUATERNIONS) { + rotateAndGenerateDirections(glm::quat(glm::vec3(0.0f, 0.0f, radian))); } else { float s = sin(radian); float c = cos(radian); @@ -93,13 +93,13 @@ void Orientation::roll( float angle ) { } } -void Orientation::rotate( float p, float y, float r ) { +void Orientation::rotate(float p, float y, float r) { pitch(p); yaw (y); roll (r); } -void Orientation::rotate( glm::vec3 eulerAngles ) { +void Orientation::rotate(glm::vec3 eulerAngles) { //this needs to be optimized! pitch(eulerAngles.x); @@ -112,13 +112,13 @@ void Orientation::rotate( glm::quat rotation ) { } -void Orientation::rotateAndGenerateDirections( glm::quat rotation ) { +void Orientation::rotateAndGenerateDirections(glm::quat rotation) { quat = quat * rotation; glm::mat4 rotationMatrix = glm::mat4_cast(quat); - right = glm::vec3( glm::vec4( IDENTITY_RIGHT, 0.0f ) * rotationMatrix ); - up = glm::vec3( glm::vec4( IDENTITY_UP, 0.0f ) * rotationMatrix ); - front = glm::vec3( glm::vec4( IDENTITY_FRONT, 0.0f ) * rotationMatrix ); + right = glm::vec3(glm::vec4(IDENTITY_RIGHT, 0.0f) * rotationMatrix); + up = glm::vec3(glm::vec4(IDENTITY_UP, 0.0f) * rotationMatrix); + front = glm::vec3(glm::vec4(IDENTITY_FRONT, 0.0f) * rotationMatrix); } diff --git a/libraries/avatars/src/Orientation.h b/libraries/avatars/src/Orientation.h index 50b400b935..4bf487be02 100755 --- a/libraries/avatars/src/Orientation.h +++ b/libraries/avatars/src/Orientation.h @@ -12,33 +12,33 @@ #include // this is where the coordinate system is represented -const glm::vec3 IDENTITY_RIGHT = glm::vec3( -1.0f, 0.0f, 0.0f ); -const glm::vec3 IDENTITY_UP = glm::vec3( 0.0f, 1.0f, 0.0f ); -const glm::vec3 IDENTITY_FRONT = glm::vec3( 0.0f, 0.0f, 1.0f ); +const glm::vec3 IDENTITY_RIGHT = glm::vec3(-1.0f, 0.0f, 0.0f); +const glm::vec3 IDENTITY_UP = glm::vec3( 0.0f, 1.0f, 0.0f); +const glm::vec3 IDENTITY_FRONT = glm::vec3( 0.0f, 0.0f, 1.0f); class Orientation { public: Orientation(); - void set( Orientation ); + void set(Orientation); void setToIdentity(); - void pitch( float p ); - void yaw ( float y ); - void roll ( float r ); + void pitch(float p); + void yaw (float y); + void roll (float r); - void rotate( float pitch, float yaw, float roll ); - void rotate( glm::vec3 EulerAngles ); - void rotate( glm::quat quaternion ); + void rotate(float pitch, float yaw, float roll); + void rotate(glm::vec3 EulerAngles); + void rotate(glm::quat quaternion); - const glm::vec3 & getRight() const { return right; } - const glm::vec3 & getUp () const { return up; } - const glm::vec3 & getFront() const { return front; } + const glm::vec3 & getRight() const {return right;} + const glm::vec3 & getUp () const {return up; } + const glm::vec3 & getFront() const {return front;} - const glm::vec3 & getIdentityRight() const { return IDENTITY_RIGHT; } - const glm::vec3 & getIdentityUp () const { return IDENTITY_UP; } - const glm::vec3 & getIdentityFront() const { return IDENTITY_FRONT; } + const glm::vec3 & getIdentityRight() const {return IDENTITY_RIGHT;} + const glm::vec3 & getIdentityUp () const {return IDENTITY_UP;} + const glm::vec3 & getIdentityFront() const {return IDENTITY_FRONT;} private: @@ -47,7 +47,7 @@ private: glm::vec3 up; glm::vec3 front; - void rotateAndGenerateDirections( glm::quat rotation ); + void rotateAndGenerateDirections(glm::quat rotation); }; #endif