(2016-05-10, 17:20)Roland Melkert Wrote: I'm still doing some research on more efficient (very expensive) tight 'inside' checks.
If anyone has some ideas?
Given that many Lego blocks are rectangular, I think adding a bounding box check for all parts that pass the bounding sphere check would be relatively fast, and improve things a lot. You can always add tighter checks later for parts that pass the bounding box check.
Another alternative is to do pixel-accurate tests, but this will only work if you are using old enough OpenGL for picking mode to be supported. I'm pretty sure that as long as you don't enable Z buffer, then picking mode can be used to find everything in the rectangle, even parts that are hidden by closer parts. But if picking mode isn't present, the pixel-color-based alternatives won't work, since they'll only tell you about the objects that aren't hidden by closer objects.