mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-19 08:18:05 +02:00
Merge pull request #8766 from ZappoMan/depthReticleFixes
fix reticle depth when not moving mouse, but moving head relative to HUD
This commit is contained in:
commit
d661ae5638
1 changed files with 11 additions and 0 deletions
|
@ -308,6 +308,17 @@ function hudReticleDistance() { // 3d distance from camera to the reticle positi
|
|||
var reticlePositionOnHUD = HMD.worldPointFromOverlay(Reticle.position);
|
||||
return Vec3.distance(reticlePositionOnHUD, HMD.position);
|
||||
}
|
||||
|
||||
function maybeAdjustReticleDepth() {
|
||||
if (HMD.active) { // set depth
|
||||
if (isPointingAtOverlay()) {
|
||||
Reticle.depth = hudReticleDistance();
|
||||
}
|
||||
}
|
||||
}
|
||||
var ADJUST_RETICLE_DEPTH_INTERVAL = 50; // 20hz
|
||||
Script.setInterval(maybeAdjustReticleDepth,ADJUST_RETICLE_DEPTH_INTERVAL);
|
||||
|
||||
function onMouseMove() {
|
||||
// Display cursor at correct depth (as in depthReticle.js), and updateMouseActivity.
|
||||
if (ignoreMouseActivity()) {
|
||||
|
|
Loading…
Reference in a new issue