mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 19:42:53 +02:00
Blue laser should be enough to hover
This commit is contained in:
parent
4fade3a53e
commit
0a018e133d
1 changed files with 4 additions and 3 deletions
|
@ -400,14 +400,15 @@ function handleMouseMoveEvent(event) { // find out which overlay (if any) is ove
|
||||||
}
|
}
|
||||||
handleMouseMove(pickRay);
|
handleMouseMove(pickRay);
|
||||||
}
|
}
|
||||||
const TRIGGER_THRESHOLD = 0.85;
|
const TRIGGER_CLICK_THRESHOLD = 0.85;
|
||||||
|
const TRIGGER_PRESS_THRESHOLD = 0.05;
|
||||||
// for some reason, I could not get trigger mappings for the LT and RT to fire. So, since we can read the
|
// for some reason, I could not get trigger mappings for the LT and RT to fire. So, since we can read the
|
||||||
// value of the RT and LT, and the messages come through as mouse moves, we have the hack below to figure out
|
// value of the RT and LT, and the messages come through as mouse moves, we have the hack below to figure out
|
||||||
// which hand is being triggered, and compute the pick ray accordingly.
|
// which hand is being triggered, and compute the pick ray accordingly.
|
||||||
//
|
//
|
||||||
function isPressed(hand) { // helper to see if the hand passed in has the trigger pulled
|
function isPressed(hand) { // helper to see if the hand passed in has the trigger pulled
|
||||||
var controller = (hand === Controller.Standard.RightHand ? Controller.Standard.RT : Controller.Standard.LT);
|
var controller = (hand === Controller.Standard.RightHand ? Controller.Standard.RT : Controller.Standard.LT);
|
||||||
return Controller.getValue(controller) > TRIGGER_THRESHOLD;
|
return Controller.getValue(controller) > TRIGGER_PRESS_THRESHOLD;
|
||||||
}
|
}
|
||||||
// helpful globals
|
// helpful globals
|
||||||
var currentHandPressed = 0;
|
var currentHandPressed = 0;
|
||||||
|
@ -451,7 +452,7 @@ function controllerComputePickRay(hand) {
|
||||||
}
|
}
|
||||||
function makeClickHandler(hand) {
|
function makeClickHandler(hand) {
|
||||||
return function (clicked) {
|
return function (clicked) {
|
||||||
if (clicked > TRIGGER_THRESHOLD) {
|
if (clicked > TRIGGER_CLICK_THRESHOLD) {
|
||||||
var pickRay = controllerComputePickRay(hand);
|
var pickRay = controllerComputePickRay(hand);
|
||||||
handleClick(pickRay);
|
handleClick(pickRay);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue