@Rontek >> a question about how linepick works in the blitz3d source code
Tweet
@Rontek >>
hi
a question about how linepick works in the blitz3d source code, (please) :
before doing the calculation that the linepick vector intersects with a triangle of a surface, does it check if a pickable mesh is near enough ? either with a distance 3d check or with a bounding box check (defined by the min, max, vertices positions of the mesh) ?
to know if i can set all meshes as pickable from the start.
or
it is worth to do a distance check to determine if a mesh is near enough, before setting it as pickable.
thanks,
does it check if a pickable mesh is near enough ?
I don't think it does that, here's the linepick code:
https://github.com/blitz-research/blitz3d/blob/6beb288cb5962393684a59a4a44ac11524894939/bbruntime/bbblitz3d.cpp#L987-L993
which points to doPick:
https://github.com/blitz-research/blitz3d/blob/6beb288cb5962393684a59a4a44ac11524894939/bbruntime/bbblitz3d.cpp#L958-L961
and lastly traceRay:
https://github.com/blitz-research/blitz3d/blob/6beb288cb5962393684a59a4a44ac11524894939/blitz3d/world.cpp#L122-L142
it does seem to iterate on all objects that have EntityPickMode collisions enabled.
thanks.
i guess that one way to confirm that would be to do a test with all meshes set as pickables and one test with only the meshes in range (near enough) set as pickable.
i will do this test and report.
Reply To Topic (minimum 10 characters)
Please log in to reply