From 69af12fbc7648ab1de36034907b40c986dd02105 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Tue, 6 Mar 2018 15:47:01 -0800 Subject: [PATCH] chaning speeds --- interface/resources/controllers/keyboardMouse.json | 4 ++-- interface/src/avatar/MyAvatar.cpp | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/interface/resources/controllers/keyboardMouse.json b/interface/resources/controllers/keyboardMouse.json index f82f6276ae..f0cb926167 100644 --- a/interface/resources/controllers/keyboardMouse.json +++ b/interface/resources/controllers/keyboardMouse.json @@ -6,8 +6,8 @@ { "from": "Keyboard.D", "when": "Keyboard.Shift", "to": "Actions.LATERAL_RIGHT" }, { "from": "Keyboard.A", "when": "Keyboard.RightMouseButton", "to": "Actions.LATERAL_LEFT" }, { "from": "Keyboard.D", "when": "Keyboard.RightMouseButton", "to": "Actions.LATERAL_RIGHT" }, - { "from": "Keyboard.E", "when": "Keyboard.Shift", "to": "Actions.BOOM_IN", "filters": [ { "type": "scale", "scale": 0.05 } ] }, - { "from": "Keyboard.C", "when": "Keyboard.Shift", "to": "Actions.BOOM_OUT", "filters": [ { "type": "scale", "scale": 0.05 } ] }, + { "from": "Keyboard.E", "to": "Actions.LATERAL_RIGHT" }, + { "from": "Keyboard.Q", "to": "Actions.LATERAL_LEFT" }, { "comment" : "Mouse turn need to be small continuous increments", diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index edb70692d9..070f4716c5 100755 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -2190,7 +2190,8 @@ void MyAvatar::updateActionMotor(float deltaTime) { if (state == CharacterController::State::Hover || _characterController.computeCollisionGroup() == BULLET_COLLISION_GROUP_COLLISIONLESS) { // we can fly --> support vertical motion - glm::vec3 up = (getDriveKey(TRANSLATE_Y)) * IDENTITY_UP; + float impulse = _sprint ? 4.0f : 1.0f; + glm::vec3 up = (getDriveKey(TRANSLATE_Y) * impulse) * IDENTITY_UP; direction += up; } @@ -2210,7 +2211,7 @@ void MyAvatar::updateActionMotor(float deltaTime) { float motorSpeed = glm::length(_actionMotorVelocity); float finalMaxMotorSpeed = getSensorToWorldScale() * DEFAULT_AVATAR_MAX_FLYING_SPEED; float speedGrowthTimescale = 2.0f; - float speedIncreaseFactor = 1.8f; + float speedIncreaseFactor = _sprint ? 5.0f : 1.8f; motorSpeed *= 1.0f + glm::clamp(deltaTime / speedGrowthTimescale, 0.0f, 1.0f) * speedIncreaseFactor; const float maxBoostSpeed = getSensorToWorldScale() * MAX_BOOST_SPEED;