mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +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);
|
var pickRay = Camera.computePickRay(mouseX, mouseY);
|
||||||
if (Math.abs(pickRay.direction.y) > 0.001) {
|
if (Math.abs(pickRay.direction.y) > 0.001) {
|
||||||
var distance = relativePoint.y / pickRay.direction.y;
|
var distance = relativePoint.y / pickRay.direction.y;
|
||||||
|
if (distance < 0.001) {
|
||||||
|
return pointOnPlane;
|
||||||
|
}
|
||||||
var pickInersection = Vec3.multiply(pickRay.direction, distance);
|
var pickInersection = Vec3.multiply(pickRay.direction, distance);
|
||||||
pickInersection = Vec3.sum(Camera.getPosition(), pickInersection);
|
pickInersection = Vec3.sum(Camera.getPosition(), pickInersection);
|
||||||
return pickInersection;
|
return pickInersection;
|
||||||
|
@ -238,7 +241,6 @@ function mouseReleaseEvent() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// new mouseMoveEvent
|
|
||||||
function mouseMoveEvent(event) {
|
function mouseMoveEvent(event) {
|
||||||
if (isGrabbing) {
|
if (isGrabbing) {
|
||||||
// see if something added/restored gravity
|
// see if something added/restored gravity
|
||||||
|
@ -321,7 +323,6 @@ function mouseMoveEvent(event) {
|
||||||
targetPosition = pointOnPlane;
|
targetPosition = pointOnPlane;
|
||||||
initialVerticalGrabPosition = targetPosition;
|
initialVerticalGrabPosition = targetPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prevMouse.x = event.x;
|
prevMouse.x = event.x;
|
||||||
|
|
Loading…
Reference in a new issue