@Override
            public void onAction(String name, boolean isPressed, float tpf) {
                if( isPressed ) {
                    CollisionResult result = pickFromCamera();
                    if( result != null ) {
                        System.out.println("Picked = " + result.getGeometry() + ", Distance = "+result.getDistance());
                    }
                }
            }
A test case for using instancing with ray casting.

Based on distance from camera, swap in/out more/less detailed geometry to/from an InstancedNode.

@author duncanj
jme3-examples/src/main/java/jme3test/scene/instancing/TestInstancedNodeAttachDetachWithPicking.java