mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 07:27:04 +02:00
Android - Fix joystick and view control bug that makes it bounce
This commit is contained in:
parent
f5a0f3d907
commit
f99b2dd23f
1 changed files with 7 additions and 0 deletions
|
@ -350,6 +350,8 @@ void TouchscreenVirtualPadDevice::touchUpdateEvent(const QTouchEvent* event) {
|
||||||
if (idxMoveStartingPointCandidate != -1) {
|
if (idxMoveStartingPointCandidate != -1) {
|
||||||
_moveCurrentTouchId = tPoints[idxMoveStartingPointCandidate].id();
|
_moveCurrentTouchId = tPoints[idxMoveStartingPointCandidate].id();
|
||||||
_unusedTouches.erase(_moveCurrentTouchId);
|
_unusedTouches.erase(_moveCurrentTouchId);
|
||||||
|
thisPoint.x = tPoints[idxMoveStartingPointCandidate].pos().x();
|
||||||
|
thisPoint.y = tPoints[idxMoveStartingPointCandidate].pos().y();
|
||||||
moveTouchBegin(thisPoint);
|
moveTouchBegin(thisPoint);
|
||||||
} else {
|
} else {
|
||||||
moveTouchEnd();
|
moveTouchEnd();
|
||||||
|
@ -359,6 +361,8 @@ void TouchscreenVirtualPadDevice::touchUpdateEvent(const QTouchEvent* event) {
|
||||||
if (idxViewStartingPointCandidate != -1) {
|
if (idxViewStartingPointCandidate != -1) {
|
||||||
_viewCurrentTouchId = tPoints[idxViewStartingPointCandidate].id();
|
_viewCurrentTouchId = tPoints[idxViewStartingPointCandidate].id();
|
||||||
_unusedTouches.erase(_viewCurrentTouchId);
|
_unusedTouches.erase(_viewCurrentTouchId);
|
||||||
|
thisPoint.x = tPoints[idxViewStartingPointCandidate].pos().x();
|
||||||
|
thisPoint.y = tPoints[idxViewStartingPointCandidate].pos().y();
|
||||||
viewTouchBegin(thisPoint);
|
viewTouchBegin(thisPoint);
|
||||||
} else {
|
} else {
|
||||||
viewTouchEnd();
|
viewTouchEnd();
|
||||||
|
@ -368,6 +372,8 @@ void TouchscreenVirtualPadDevice::touchUpdateEvent(const QTouchEvent* event) {
|
||||||
if (idxJumpStartingPointCandidate != -1) {
|
if (idxJumpStartingPointCandidate != -1) {
|
||||||
_jumpCurrentTouchId = tPoints[idxJumpStartingPointCandidate].id();
|
_jumpCurrentTouchId = tPoints[idxJumpStartingPointCandidate].id();
|
||||||
_unusedTouches.erase(_jumpCurrentTouchId);
|
_unusedTouches.erase(_jumpCurrentTouchId);
|
||||||
|
thisPoint.x = tPoints[idxJumpStartingPointCandidate].pos().x();
|
||||||
|
thisPoint.y = tPoints[idxJumpStartingPointCandidate].pos().y();
|
||||||
jumpTouchBegin(thisPoint);
|
jumpTouchBegin(thisPoint);
|
||||||
} else {
|
} else {
|
||||||
if (_jumpHasValidTouch) {
|
if (_jumpHasValidTouch) {
|
||||||
|
@ -424,6 +430,7 @@ void TouchscreenVirtualPadDevice::moveTouchBegin(glm::vec2 touchPoint) {
|
||||||
} else {
|
} else {
|
||||||
_moveRefTouchPoint = touchPoint;
|
_moveRefTouchPoint = touchPoint;
|
||||||
}
|
}
|
||||||
|
_moveCurrentTouchPoint = touchPoint;
|
||||||
_moveHasValidTouch = true;
|
_moveHasValidTouch = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue