Skip to content

Conversation

@vincentfretin
Copy link
Contributor

Description:

When I tried to update https://aframe-xr-starterkit.glitch.me to use master, the buttons on the wrist were not clickable anymore.

  <script src="https://cdn.jsdelivr.net/gh/aframevr/aframe@4d97225a04cfdc9ab3e44f84687f70d6816a366b/dist/aframe-master.min.js"></script><!-- Dec 31, 2024 not working -->
  <!--<script src="https://cdn.jsdelivr.net/gh/aframevr/aframe@86d847fa80dcaa1c7306a93890000d5bb3183416/dist/aframe-master.min.js"></script>--><!-- Nov 15, 2024 not working, include https://github.com/aframevr/aframe/commit/655ab162d43f3d67327d4da69c3625aef324abb0 -->
  <!--<script src="https://cdn.jsdelivr.net/gh/aframevr/aframe@8e52e89e813b440ee52e0a78aaddde33f98657e0/dist/aframe-master.min.js"></script>--><!-- Nov 15, 2024 working, don't include https://github.com/aframevr/aframe/commit/655ab162d43f3d67327d4da69c3625aef324abb0 -->

The culpurit was commit 655ab16 that removed the webxr listeners for cursor with rayOrigin: entity (the default).

Changes proposed:

  • Modify the check to use rayOrigin !== mouse, that what it was really before the commit
@vincentfretin
Copy link
Contributor Author

After discussion in #5623 I also changed the conditions in update.

this.updateMouseEventListeners();
// Update the WebXR event listeners if needed
if (this.data.rayOrigin === 'xrselect') {
if (this.data.rayOrigin !== 'mouse') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be explicit. If in the future we add an option to rayOrigin this might be no longer correct.

var rayOrigin = this.data.rayOrigin;
if (rayOrigin === 'entity' || rayOrigin === 'xrselect') {
  this.addWebXREventListeners();
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I also added additional comments for the next person that reads this component code in the future.

@dmarcos
Copy link
Member

dmarcos commented Jan 10, 2025

Thanks!

@dmarcos dmarcos merged commit 318f320 into aframevr:master Jan 10, 2025
3 checks passed
@vincentfretin vincentfretin deleted the fix-cursor branch January 10, 2025 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants