mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 19:50:38 +02:00
Merge pull request #8149 from howard-stearns/limit-hand-controller-actions-to-recommended-area
limit hand controller actions to recommended area
This commit is contained in:
commit
7dd53d7757
1 changed files with 10 additions and 0 deletions
|
@ -125,8 +125,17 @@ function ignoreMouseActivity() {
|
||||||
weMovedReticle = false;
|
weMovedReticle = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
var MARGIN = 25;
|
||||||
|
var reticleMinX = MARGIN, reticleMaxX, reticleMinY = MARGIN, reticleMaxY;
|
||||||
|
function updateRecommendedArea() {
|
||||||
|
var dims = Controller.getViewportDimensions();
|
||||||
|
reticleMaxX = dims.x - MARGIN;
|
||||||
|
reticleMaxY = dims.y - MARGIN;
|
||||||
|
}
|
||||||
var setReticlePosition = function (point2d) {
|
var setReticlePosition = function (point2d) {
|
||||||
weMovedReticle = true;
|
weMovedReticle = true;
|
||||||
|
point2d.x = Math.max(reticleMinX, Math.min(point2d.x, reticleMaxX));
|
||||||
|
point2d.y = Math.max(reticleMinY, Math.min(point2d.y, reticleMaxY));
|
||||||
Reticle.setPosition(point2d);
|
Reticle.setPosition(point2d);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -458,6 +467,7 @@ setupHandler(Script.update, update);
|
||||||
var SETTINGS_CHANGE_RECHECK_INTERVAL = 10 * 1000; // milliseconds
|
var SETTINGS_CHANGE_RECHECK_INTERVAL = 10 * 1000; // milliseconds
|
||||||
function checkSettings() {
|
function checkSettings() {
|
||||||
updateFieldOfView();
|
updateFieldOfView();
|
||||||
|
updateRecommendedArea();
|
||||||
}
|
}
|
||||||
checkSettings();
|
checkSettings();
|
||||||
var settingsChecker = Script.setInterval(checkSettings, SETTINGS_CHANGE_RECHECK_INTERVAL);
|
var settingsChecker = Script.setInterval(checkSettings, SETTINGS_CHANGE_RECHECK_INTERVAL);
|
||||||
|
|
Loading…
Reference in a new issue