From 301c3c564999bcb39e7cfdc56fe9b751bdaec93b Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Mon, 5 May 2014 13:47:11 -0700 Subject: [PATCH] don't ignore wall collisions when walking also reduced max walk speed --- interface/src/avatar/MyAvatar.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 5d07e3631b..975665fc45 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -675,7 +675,7 @@ void MyAvatar::updateMotorFromKeyboard(float deltaTime, bool walking) { direction /= directionLength; // the finalMotorSpeed depends on whether we are walking or not const float MIN_KEYBOARD_CONTROL_SPEED = 2.0f; - const float MAX_WALKING_SPEED = 4.0f * MIN_KEYBOARD_CONTROL_SPEED; + const float MAX_WALKING_SPEED = 3.0f * MIN_KEYBOARD_CONTROL_SPEED; float finalMaxMotorSpeed = walking ? MAX_WALKING_SPEED : _maxMotorSpeed; float motorLength = glm::length(_motorVelocity); @@ -979,11 +979,11 @@ void MyAvatar::updateCollisionWithVoxels(float deltaTime, float radius) { } else { float distance = glm::dot(_gravity, collision->_contactPoint - oldPosition); float penetration = glm::dot(_gravity, collision->_penetration); - if (distance - distanceToFloor > penetrationWithFloor || penetration > penetrationWithFloor) { + if (fabsf(distance - distanceToFloor) > penetrationWithFloor || penetration > penetrationWithFloor) { // resolution of the deepest penetration would not resolve this one // so we apply the collision applyHardCollision(collision->_penetration, VOXEL_ELASTICITY, VOXEL_DAMPING); - } + } } } }