Hi, I started a new project recently with jME and I’m playing around with the physics system.
I’m using rayTest() for picking, the problem I have is that the results are sorted in the order the objects were added to the space and not by proximity (like when using Ray collisions).
I want to know which is the nearest so I don’t shot enemies behind walls.
How would you suggest I’d do that?
Doing a Ray collision with the results from the rayTest()? doing a Ray collision from the beginning? Sorting the results manually?