Ray casting in Jmonkey

Hi, guys.

I'm a newbie from Jmonkey and I need your help.

I'm trying to do a Ray Casting in Jmonkey. I mean, Ray casting is the same as ray tracing except that calculation stops on the first hit.

I have seen Ray class, but this ray is infinite.  I need it for intelligent camera.

There is none, due to not having a scene maagement -> stuff not sorted by distance -> the first hit is not the nearest usually.

Do a ray, set sorting for it to true, and get the first object it says it has hit.

I cannot view sort method in ray. Should I do it manually?

When i remember right it was on the result not on the ray

there is a little example which uses ray's


"PickResults.setCheckDistance(boolean checkDistance)

Sets if these pick results will order the data by distance from the origin of the Ray."