LinePick - possible speedup?

Blitz3D Forums/Blitz3D Programming/LinePick - possible speedup?

Assuming that when you do a line pick, Blitz first checks the bounding spheres to see if the line pikc intersects them, then yes, it would speed things up.

That said, Blitz apparently does not do things in the most optimal way all the time. For example, hiding entities outside the view of the camera manually is faster than just leaving them visible, even when no collisions are enabled. This appears to indicate that Blitz doesn't even do basic sphere-frustrum tests before it tries to render the world.

So it is entirely possible that linepick also does not do such a test. In which case, you could speed it up by writing a function to determine if a line intersects a sphere, and doing your own culling that way. I think someone put a function I wrote for them that does line-sphere or maybe it was ray-sphere intersection in the code archives.

The only way to know unfortunately is to code a test program to see if checking manually is faster than letting bLitz just do it's thing.

Also, spheres are not the only way to cull secitons of level. If your level is static it would be possible to build a BSP tree. A BSP tree might help you do linepicks much faster, though I don't know how.