i’ve spent the last 2.5 days completely stuck on this issue, and i’d love to receive some help.
i promise to credit the tip giver with a link back to this thread here.
Consider using meaningful names in code - currently it’s pretty much impossible to understand or debug it. With names like t, s2 etc. it’s becoming hard to indicate the purpose of specific variables.
In any code besides short and simple JS scripts, avoid using vars - especially in the way you’ve used them in places like this - this, and all other, vars are moved to the top of the current (usually function / class, not the closest if or { ) context and are very likely to collide at some point. Use const instead.
As for the raycasting, try setting the second parameter of intersectObjects to true.
Even with partial explanations of what s2 is, there’s still no way to debug this code. It’s unformatted and uses vars all over the place
If setting recursive parameter to true didn’t work - then anything could be at fault. Console.log value of the objects you’re trying to intersect and the ray - see if these values make sense (raycasting is independent of rendering and visibility - so as long as you pass a properly pointing ray and an array of valid Three.Mesh objects, it should work ok.)
(Side-note: If you’re working with classes of 2000+ lines, and now you mention you store arrays of circular dependencies, you pretty much are not allowed to not use typescript.)
and ‘var’ has a limited scope conditions set, ‘const’ is readonly and way too strict for my liking…
i do work a lot with large classes, my universal web theme editor that comes with my software is atm 2610 lines long. i have a small bunch of files like that. around a dozen.