From b9fb8880731da83192765e9e11b2ceb49cc38a4f Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Thu, 25 Apr 2013 10:02:14 -0700 Subject: [PATCH] Small speed/cleanup to thrust setting --- interface/src/Avatar.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/interface/src/Avatar.cpp b/interface/src/Avatar.cpp index 05ea1399f1..82d9f3334f 100644 --- a/interface/src/Avatar.cpp +++ b/interface/src/Avatar.cpp @@ -397,28 +397,22 @@ void Avatar::simulate(float deltaTime) { _thrust = glm::vec3( 0.0, 0.0, 0.0 ); if (_driveKeys[FWD]) { - glm::vec3 front( _orientation.getFront().x, _orientation.getFront().y, _orientation.getFront().z ); - _thrust += front * THRUST_MAG; + _thrust += _orientation.getFront() * THRUST_MAG; } if (_driveKeys[BACK]) { - glm::vec3 front( _orientation.getFront().x, _orientation.getFront().y, _orientation.getFront().z ); - _thrust -= front * THRUST_MAG; + _thrust -= _orientation.getFront() * THRUST_MAG; } if (_driveKeys[RIGHT]) { - glm::vec3 right( _orientation.getRight().x, _orientation.getRight().y, _orientation.getRight().z ); - _thrust += right * THRUST_MAG; + _thrust += _orientation.getRight() * THRUST_MAG; } if (_driveKeys[LEFT]) { - glm::vec3 right( _orientation.getRight().x, _orientation.getRight().y, _orientation.getRight().z ); - _thrust -= right * THRUST_MAG; + _thrust -= _orientation.getRight() * THRUST_MAG; } if (_driveKeys[UP]) { - glm::vec3 up( _orientation.getUp().x, _orientation.getUp().y, _orientation.getUp().z ); - _thrust += up * THRUST_MAG; + _thrust += _orientation.getUp() * THRUST_MAG; } if (_driveKeys[DOWN]) { - glm::vec3 up( _orientation.getUp().x, _orientation.getUp().y, _orientation.getUp().z ); - _thrust -= up * THRUST_MAG; + _thrust -= _orientation.getUp() * THRUST_MAG; } if (_driveKeys[ROT_RIGHT]) { _bodyYawDelta -= YAW_MAG * deltaTime;