mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 04:53:25 +02:00
Merge pull request #995 from PhilipRosedale/master
Touch-look much smoother when flying
This commit is contained in:
commit
8b27a4c0a1
2 changed files with 14 additions and 14 deletions
|
@ -1907,11 +1907,11 @@ void Application::update(float deltaTime) {
|
||||||
|
|
||||||
// Update from Touch
|
// Update from Touch
|
||||||
if (_isTouchPressed) {
|
if (_isTouchPressed) {
|
||||||
float TOUCH_YAW_SCALE = -50.0f;
|
float TOUCH_YAW_SCALE = -0.25f;
|
||||||
float TOUCH_PITCH_SCALE = -50.0f;
|
float TOUCH_PITCH_SCALE = -12.5f;
|
||||||
_yawFromTouch += ((_touchAvgX - _lastTouchAvgX) * TOUCH_YAW_SCALE * deltaTime);
|
float FIXED_TOUCH_TIMESTEP = 0.016f;
|
||||||
_pitchFromTouch += ((_touchAvgY - _lastTouchAvgY) * TOUCH_PITCH_SCALE * deltaTime);
|
_yawFromTouch += ((_touchAvgX - _lastTouchAvgX) * TOUCH_YAW_SCALE * FIXED_TOUCH_TIMESTEP);
|
||||||
|
_pitchFromTouch += ((_touchAvgY - _lastTouchAvgY) * TOUCH_PITCH_SCALE * FIXED_TOUCH_TIMESTEP);
|
||||||
_lastTouchAvgX = _touchAvgX;
|
_lastTouchAvgX = _touchAvgX;
|
||||||
_lastTouchAvgY = _touchAvgY;
|
_lastTouchAvgY = _touchAvgY;
|
||||||
}
|
}
|
||||||
|
@ -2061,7 +2061,7 @@ void Application::updateAvatar(float deltaTime) {
|
||||||
|
|
||||||
// rotate body yaw for yaw received from multitouch
|
// rotate body yaw for yaw received from multitouch
|
||||||
_myAvatar.setOrientation(_myAvatar.getOrientation()
|
_myAvatar.setOrientation(_myAvatar.getOrientation()
|
||||||
* glm::quat(glm::vec3(0, _yawFromTouch * deltaTime, 0)));
|
* glm::quat(glm::vec3(0, _yawFromTouch, 0)));
|
||||||
_yawFromTouch = 0.f;
|
_yawFromTouch = 0.f;
|
||||||
|
|
||||||
// Update my avatar's state from gyros and/or webcam
|
// Update my avatar's state from gyros and/or webcam
|
||||||
|
|
Loading…
Reference in a new issue