Add support for custom raycaster intersection classes#6
Merged
MakingSpiderSense merged 1 commit intoJul 10, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
Adds support for a customizable raycaster intersection class for the holdable component and standardizes the grab-position attribute name.
- Documentation updated to describe custom intersection class and new scene-level attribute.
- Logic added to read
data-holdable-intersection-classfrom<a-scene>and apply it to entities. - Renamed scene grab-position attribute from
data-grab-positiontodata-holdable-grab-position.
Comments suppressed due to low confidence (4)
src/components/holdable/holdable.js:11
- [nitpick] The prefix "Rare:" is nonstandard and may confuse readers. Consider replacing it with "Note:" or aligning it with the existing list labels for clarity.
* - Rare: If you want to use another class for raycaster intersections instead of "interactable", you can add it globally to the scene using `data-holdable-intersection-class="your-class"`. This will be used for all holdable objects unless overridden.
src/components/holdable/holdable.js:11
- The documentation mentions "unless overridden," but the code only reads the scene-level attribute. Either remove that phrase or implement per-entity override support to match the docs.
* - Rare: If you want to use another class for raycaster intersections instead of "interactable", you can add it globally to the scene using `data-holdable-intersection-class="your-class"`. This will be used for all holdable objects unless overridden.
src/components/holdable/holdable.js:45
- Add unit tests to verify that the
data-holdable-intersection-classattribute is correctly read from the scene and applied to entities.
const sceneIntersectionClass = this.el.sceneEl.getAttribute("data-holdable-intersection-class");
src/components/holdable/holdable.js:45
- [nitpick] Consider also checking for a per-entity
data-holdable-intersection-classattribute (e.g.,this.el.getAttribute(...)) so users can override the intersection class on individual holdable objects.
const sceneIntersectionClass = this.el.sceneEl.getAttribute("data-holdable-intersection-class");
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for custom raycaster intersection classes, rather than using the “interactable” class. Use
data-holdable-intersection-class="your-class"on<a-scene>to set a custom class.https://trello.com/c/B3O8ZNKt