Fix to make touch-look MUCH smoother for flying around

This commit is contained in:
Philip Rosedale 2013-09-30 12:43:25 -07:00
parent 86b4b7079d
commit f30ff1704a
2 changed files with 14 additions and 14 deletions

View file

@ -1908,11 +1908,11 @@ void Application::update(float deltaTime) {
// Update from Touch
if (_isTouchPressed) {
float TOUCH_YAW_SCALE = -50.0f;
float TOUCH_PITCH_SCALE = -50.0f;
_yawFromTouch += ((_touchAvgX - _lastTouchAvgX) * TOUCH_YAW_SCALE * deltaTime);
_pitchFromTouch += ((_touchAvgY - _lastTouchAvgY) * TOUCH_PITCH_SCALE * deltaTime);
float TOUCH_YAW_SCALE = -0.25f;
float TOUCH_PITCH_SCALE = -12.5f;
float FIXED_TOUCH_TIMESTEP = 0.016f;
_yawFromTouch += ((_touchAvgX - _lastTouchAvgX) * TOUCH_YAW_SCALE * FIXED_TOUCH_TIMESTEP);
_pitchFromTouch += ((_touchAvgY - _lastTouchAvgY) * TOUCH_PITCH_SCALE * FIXED_TOUCH_TIMESTEP);
_lastTouchAvgX = _touchAvgX;
_lastTouchAvgY = _touchAvgY;
}
@ -2062,7 +2062,7 @@ void Application::updateAvatar(float deltaTime) {
// rotate body yaw for yaw received from multitouch
_myAvatar.setOrientation(_myAvatar.getOrientation()
* glm::quat(glm::vec3(0, _yawFromTouch * deltaTime, 0)));
* glm::quat(glm::vec3(0, _yawFromTouch, 0)));
_yawFromTouch = 0.f;
// Update my avatar's state from gyros and/or webcam

View file

@ -80,14 +80,14 @@ enum AvatarBodyBallID {
BODY_BALL_RIGHT_ELBOW,
BODY_BALL_RIGHT_WRIST,
BODY_BALL_RIGHT_FINGERTIPS,
BODY_BALL_LEFT_HIP,
BODY_BALL_LEFT_KNEE,
BODY_BALL_LEFT_HEEL,
BODY_BALL_LEFT_TOES,
BODY_BALL_RIGHT_HIP,
BODY_BALL_RIGHT_KNEE,
BODY_BALL_RIGHT_HEEL,
BODY_BALL_RIGHT_TOES,
BODY_BALL_LEFT_HIP,
BODY_BALL_LEFT_KNEE,
BODY_BALL_LEFT_HEEL,
BODY_BALL_LEFT_TOES,
BODY_BALL_RIGHT_HIP,
BODY_BALL_RIGHT_KNEE,
BODY_BALL_RIGHT_HEEL,
BODY_BALL_RIGHT_TOES,
NUM_AVATAR_BODY_BALLS
};