mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
less bad behavior when dragging across horizon
This commit is contained in:
parent
d486899aad
commit
139ebca258
1 changed files with 3 additions and 2 deletions
|
@ -106,6 +106,9 @@ function xzPickRayIntersetion(pointOnPlane, mouseX, mouseY) {
|
|||
var pickRay = Camera.computePickRay(mouseX, mouseY);
|
||||
if (Math.abs(pickRay.direction.y) > 0.001) {
|
||||
var distance = relativePoint.y / pickRay.direction.y;
|
||||
if (distance < 0.001) {
|
||||
return pointOnPlane;
|
||||
}
|
||||
var pickInersection = Vec3.multiply(pickRay.direction, distance);
|
||||
pickInersection = Vec3.sum(Camera.getPosition(), pickInersection);
|
||||
return pickInersection;
|
||||
|
@ -238,7 +241,6 @@ function mouseReleaseEvent() {
|
|||
}
|
||||
}
|
||||
|
||||
// new mouseMoveEvent
|
||||
function mouseMoveEvent(event) {
|
||||
if (isGrabbing) {
|
||||
// see if something added/restored gravity
|
||||
|
@ -321,7 +323,6 @@ function mouseMoveEvent(event) {
|
|||
targetPosition = pointOnPlane;
|
||||
initialVerticalGrabPosition = targetPosition;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
prevMouse.x = event.x;
|
||||
|
|
Loading…
Reference in a new issue