Skip to content

Conversation

kylebakerio
Copy link

fixes bug described here and shown here. You can remix that glitch and swap out commented line 193/192 to see the effect of this change there.

Basically:

"".split(",")
// -> [""]
[""].push(".selector")
// -> ["",".selector"]
["",".selector"].join(",")
// -> ",.selector"

raycaster then interprets ",.selector" as a faulty css selector down the line in raycaster.js line 152, here:

      // note: data.objects === ",.selector"
      
      this.el.sceneEl.querySelectorAll(data.objects)

kylebakerio and others added 4 commits December 29, 2020 11:57
fixes bug described [here](supermedium#26 (comment)) and shown [here](). You can remix that glitch and swap out commented line 193/192 to see the effect of this change there. 

Basically:
```
"".split(",")
// -> [""]
[""].push(".selector")
// -> ["",".selector"]
["",".selector"].join(",")
// -> ",.selector"
```
…ta.objects is an array instead of string

fix for error `raycaster.objects.split is not a function`, because this can be an array instead of a string; when I hit the error, I was able to see at that point in execution:
```
console.log(raycaster.data.objects)
//=> ["[gui-interactable]", ".raycastable"]
```
fix for "raycaster.objects.split is not a function" when raycaster.data.objects is an array instead of string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant