diff --git a/src/hub.html b/src/hub.html index 9344cbe2c88cac105507a960fd62cb3c3bd7a1ec..b935796c02caec4cfeda0a3a7f712ca0b47f0990 100644 --- a/src/hub.html +++ b/src/hub.html @@ -154,7 +154,7 @@ set-yxz-order pinnable > - <a-entity class="interactable-ui" stop-event-propagation__grab-start="event: grab-start" stop-event-propagation__grab-end="event: grab-end"> + <a-entity class="ui interactable-ui" stop-event-propagation__grab-start="event: grab-start" stop-event-propagation__grab-end="event: grab-end"> <a-entity class="freeze-menu" visible-while-frozen="withinDistance: 3;"> <a-entity mixin="rounded-text-action-button" pin-networked-object-button="labelSelector:.pin-button-label; hideWhenPinnedSelector:.hide-when-pinned; uiSelector:.interactable-ui" position="0 0.125 0.01"> </a-entity> <a-entity class="pin-button-label" text=" value:pin; width:1.75; align:center;" text-raycast-hack position="0 0.125 0.02"></a-entity> @@ -171,7 +171,7 @@ super-networked-interactable="counter: #pen-counter;" body="type: dynamic; shape: none; mass: 1;" grabbable="maxGrabbers: 1" - sticky-object="autoLockOnRelease: true; autoLockOnLoad: true; autoLockSpeedLimit: 0;" + sticky-object="autoLockOnRelease: true; autoLockOnLoad: true;" hoverable scale="0.5 0.5 0.5" > @@ -185,7 +185,7 @@ segments-width="16" segments-height="12" ></a-sphere> - <a-entity class="delete-button" visible-while-frozen="withinDistance: 3;"> + <a-entity class="ui delete-button" visible-while-frozen="withinDistance: 3;"> <a-entity mixin="rounded-text-button" remove-networked-object-button position="0 0 0"> </a-entity> <a-entity text=" value:remove; width:2.5; align:center;" text-raycast-hack position="0 0 0.01"></a-entity> </a-entity> @@ -207,7 +207,7 @@ set-yxz-order auto-scale-cannon-physics-body > - <a-entity class="delete-button" visible-while-frozen="withinDistance: 3;"> + <a-entity class="ui delete-button" visible-while-frozen="withinDistance: 3;"> <a-entity mixin="rounded-text-button" remove-networked-object-button position="0 0 0"> </a-entity> <a-entity text=" value:remove; width:2.5; align:center;" text-raycast-hack position="0 0 0.01"></a-entity> </a-entity> @@ -221,7 +221,7 @@ </template> <template id="paging-toolbar"> - <a-entity class="paging-toolbar" visible-to-owner> + <a-entity class="ui paging-toolbar" visible-to-owner> <a-entity class="prev-button" position="-0.3 0 0"> <a-entity mixin="rounded-text-button" slice9="width: 0.2"> </a-entity> <a-entity text=" value:<; width:2; align:center;" text-raycast-hack position="0 0 0.01"></a-entity> diff --git a/src/hub.js b/src/hub.js index bffa1d5863b70c72fa3b1114a6a81914f8fe128a..3bf72d8953fd3641d99b6c46c72f7f4ceee3621f 100644 --- a/src/hub.js +++ b/src/hub.js @@ -114,7 +114,6 @@ import "./components/cardboard-controls"; import "./components/cursor-controller"; import "./components/nav-mesh-helper"; -import "./systems/tunnel-effect"; import "./components/tools/pen"; import "./components/tools/networked-drawing"; diff --git a/src/systems/userinput/bindings/keyboard-mouse-user.js b/src/systems/userinput/bindings/keyboard-mouse-user.js index 46e5edaf7a22f543e3fbcab3b52ffb8b69312f80..30c34721779dc577689608eba838ccac448a8efd 100644 --- a/src/systems/userinput/bindings/keyboard-mouse-user.js +++ b/src/systems/userinput/bindings/keyboard-mouse-user.js @@ -328,5 +328,13 @@ export const keyboardMouseUserBindings = { dest: { value: paths.actions.cursor.grab }, xform: xforms.rising } + ], + + [sets.cursorHoveringOnUI]: [ + { + src: { value: paths.device.mouse.buttonLeft }, + dest: { value: paths.actions.cursor.grab }, + xform: xforms.rising + } ] }; diff --git a/src/systems/userinput/bindings/oculus-touch-user.js b/src/systems/userinput/bindings/oculus-touch-user.js index ecdff220224641915959c90cc69e604daa972b7e..6bb793a29e1d81cc87fa04151f4e4aeb281bdec0 100644 --- a/src/systems/userinput/bindings/oculus-touch-user.js +++ b/src/systems/userinput/bindings/oculus-touch-user.js @@ -15,16 +15,8 @@ const scaledLeftJoyX = `${name}left/scaledJoyX`; const scaledLeftJoyY = `${name}left/scaledJoyY`; const rightGripFalling = "${name}right/GripFalling"; const rightTriggerFalling = `${name}right/TriggerFalling`; -const cursorDrop2 = `${name}right/cursorDrop2`; -const cursorDrop1 = `${name}right/cursorDrop1`; -const rightHandDrop2 = `${name}right/rightHandDrop2`; -const rightHandDrop1 = `${name}right/rightHandDrop1`; const rightGripRising = `${name}right/GripRising`; const rightTriggerRising = `${name}right/TriggerRising`; -const rightGripRisingGrab = `${name}right/grip/RisingGrab`; -const rightTriggerRisingGrab = `${name}right/trigger/RisingGrab`; -const leftGripRisingGrab = `${name}left/grip/RisingGrab`; -const leftTriggerRisingGrab = `${name}left/trigger/RisingGrab`; const leftGripFalling = `${name}left/GripFalling`; const leftGripRising = `${name}left/GripRising`; const leftTriggerRising = `${name}left/TriggerRising`; @@ -425,22 +417,10 @@ export const oculusTouchUserBindings = { [sets.leftHandHoveringOnInteractable]: [ { src: { value: leftButton("grip").pressed }, - dest: { value: leftGripRisingGrab }, + dest: { value: paths.actions.leftHand.grab }, xform: xforms.rising, root: leftGripRising, priority: 200 - }, - { - src: { value: leftButton("trigger").pressed }, - dest: { value: leftTriggerRisingGrab }, - xform: xforms.rising, - root: leftTriggerRising, - priority: 200 - }, - { - src: [leftGripRisingGrab, leftTriggerRisingGrab], - dest: { value: paths.actions.leftHand.grab }, - xform: xforms.any } ], @@ -523,22 +503,10 @@ export const oculusTouchUserBindings = { [sets.cursorHoveringOnInteractable]: [ { src: { value: rightButton("grip").pressed }, - dest: { value: rightGripRisingGrab }, + dest: { value: paths.actions.cursor.grab }, xform: xforms.rising, root: rightGripRising, priority: 200 - }, - { - src: { value: rightButton("trigger").pressed }, - dest: { value: rightTriggerRisingGrab }, - xform: xforms.rising, - root: rightTriggerRising, - priority: 200 - }, - { - src: [rightGripRisingGrab, rightTriggerRisingGrab], - dest: { value: paths.actions.cursor.grab }, - xform: xforms.any } ], @@ -550,25 +518,11 @@ export const oculusTouchUserBindings = { }, { src: { value: rightButton("grip").pressed }, - dest: { value: cursorDrop1 }, + dest: { value: paths.actions.cursor.drop }, xform: xforms.falling, root: rightGripFalling, priority: 200 }, - { - src: { value: rightButton("trigger").pressed }, - dest: { - value: cursorDrop2 - }, - xform: xforms.falling, - root: rightTriggerFalling, - priority: 200 - }, - { - src: [cursorDrop1, cursorDrop2], - dest: { value: paths.actions.cursor.drop }, - xform: xforms.any - }, { src: null, dest: { value: ensureFrozenViaButtons }, @@ -598,47 +552,21 @@ export const oculusTouchUserBindings = { [sets.rightHandHoveringOnInteractable]: [ { src: { value: rightButton("grip").pressed }, - dest: { value: rightGripRisingGrab }, + dest: { value: paths.actions.rightHand.grab }, xform: xforms.rising, root: rightGripRising, priority: 200 - }, - { - src: { value: rightButton("trigger").pressed }, - dest: { value: rightTriggerRisingGrab }, - xform: xforms.rising, - root: rightTriggerRising, - priority: 200 - }, - { - src: [rightGripRisingGrab, rightTriggerRisingGrab], - dest: { value: paths.actions.rightHand.grab }, - xform: xforms.any } ], [sets.rightHandHoldingInteractable]: [ { src: { value: rightButton("grip").pressed }, - dest: { value: rightHandDrop1 }, + dest: { value: paths.actions.rightHand.drop }, xform: xforms.falling, root: rightGripFalling, priority: 200 }, - { - src: { value: rightButton("trigger").pressed }, - dest: { - value: rightHandDrop2 - }, - xform: xforms.falling, - root: rightTriggerFalling, - priority: 200 - }, - { - src: [rightHandDrop1, rightHandDrop2], - dest: { value: paths.actions.rightHand.drop }, - xform: xforms.any - }, { src: null, dest: { value: ensureFrozenViaButtons }, diff --git a/src/systems/userinput/resolve-action-sets.js b/src/systems/userinput/resolve-action-sets.js index 4341064a1085ba55f3584d4a3a5e00bcd5a8d6d7..b0187fa921399bb23ff608df8a4dc8b50e0c0a69 100644 --- a/src/systems/userinput/resolve-action-sets.js +++ b/src/systems/userinput/resolve-action-sets.js @@ -83,11 +83,18 @@ export function updateActionSetsBasedOnSuperhands() { // Cursor cursorController.enabled = !(rightHandTeleporting || rightHandHovering || rightHandGrabbing); + const cursorHoveringOnUI = + cursorController.enabled && + !rightHandTeleporting && + !rightHandHovering && + !rightHandGrabbing && + (cursorHand.has("hover-start") && cursorHand.get("hover-start").matches(".ui, .ui *")); const cursorHoveringOnInteractable = cursorController.enabled && !rightHandTeleporting && !rightHandHovering && !rightHandGrabbing && + !cursorHoveringOnUI && cursorHand.has("hover-start") && cursorHand.get("hover-start").matches(".interactable, .interactable *"); const cursorHoveringOnCamera = @@ -95,18 +102,14 @@ export function updateActionSetsBasedOnSuperhands() { !rightTeleporter.active && !rightHandHovering && !rightHandGrabbing && + !cursorHoveringOnUI && (cursorHand.has("hover-start") && cursorHand.get("hover-start").matches(".icamera, .icamera *")); - const cursorHoveringOnUI = - cursorController.enabled && - !rightHandTeleporting && - !rightHandHovering && - !rightHandGrabbing && - (cursorHand.has("hover-start") && cursorHand.get("hover-start").matches(".ui, .ui *")); const cursorHoveringOnPen = cursorController.enabled && !rightHandTeleporting && !rightHandHovering && !rightHandGrabbing && + !cursorHoveringOnUI && cursorHand.has("hover-start") && cursorHand.get("hover-start").matches(".pen, .pen *"); const cursorHoldingInteractable =