MinieExamples/src/main/java/jme3utilities/minie/test/TargetDemo.java
/**
     * Cast a physics ray from the cursor and select the nearest rigid body in
     * the result.
     */
Cast a physics ray from the cursor and select the nearest rigid body in
the result.
Cast a physics ray from the cursor and select the nearest rigid body in the result .
private void pick() {
        List<PhysicsRayTestResult> hits = rayTestCursor();
        for (PhysicsRayTestResult hit : hits) {
            PhysicsCollisionObject pco = hit.getCollisionObject();
            if (pco instanceof PhysicsRigidBody) {
                selectBody((PhysicsRigidBody) pco);
                return;
            }
        }
        selectBody(null);
    }
private void pick ( ) { List < PhysicsRayTestResult > hits = rayTestCursor ( ) ; for ( PhysicsRayTestResult hit : hits ) { PhysicsCollisionObject pco = hit . getCollisionObject ( ) ; if ( pco instanceof PhysicsRigidBody ) { selectBody ( ( PhysicsRigidBody ) pco ) ; return ; } } selectBody ( null ) ; }
Cast a physics ray from the cursor and select the nearest rigid body in
 the result.
Cast a physics ray from the cursor and select the nearest rigid body in the result .