Commit 7343474d authored by Amanda Ghassaei's avatar Amanda Ghassaei

small ui bug

parent f7968d30
...@@ -1745,6 +1745,8 @@ var GUIVR = function DATGUIVR() { ...@@ -1745,6 +1745,8 @@ var GUIVR = function DATGUIVR() {
mouseInput.intersections = performMouseInput(hitscanObjects, mouseInput); mouseInput.intersections = performMouseInput(hitscanObjects, mouseInput);
} }
var intersectingGUI = false;
inputObjects.forEach(function () { inputObjects.forEach(function () {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
if (!_ref.enabled) return; if (!_ref.enabled) return;
...@@ -1770,18 +1772,21 @@ var GUIVR = function DATGUIVR() { ...@@ -1770,18 +1772,21 @@ var GUIVR = function DATGUIVR() {
// laser.geometry.vertices[ 1 ].copy( tPosition ).add( tDirection.multiplyScalar( 1 ) ); // laser.geometry.vertices[ 1 ].copy( tPosition ).add( tDirection.multiplyScalar( 1 ) );
var intersections = raycast.intersectObjects(hitscanObjects, false); var intersections = raycast.intersectObjects(hitscanObjects, false);
if (intersections.length == 0){ if (intersections.length > 0) intersectingGUI = true;
for (var i=0;i<controllers.length;i++){
if (controllers[i].visible) {
if (controllers[i].collapseOptions) controllers[i].collapseOptions();
}
}
}
parseIntersections(intersections, laser, cursor); parseIntersections(intersections, laser, cursor);
inputObjects[index].intersections = intersections; inputObjects[index].intersections = intersections;
}); });
if (!intersectingGUI){
for (var i=0;i<controllers.length;i++){
if (controllers[i].visible) {
if (controllers[i].collapseOptions) controllers[i].collapseOptions();
}
}
}
var inputs = inputObjects.slice(); var inputs = inputObjects.slice();
if (mouseEnabled) { if (mouseEnabled) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment