/** * Check if the geometry component of this shape node under path intersects with the pickRay. * * @return true if intersected else false. If return is true, dist contains the closest distance * of intersection. * @exception IllegalArgumentException if <code>path</code> is invalid. */ boolean intersect(SceneGraphPath path, PickShape pickShape, double[] dist) { int flags; PickInfo pickInfo = new PickInfo(); Transform3D localToVworld = path.getTransform(); if (localToVworld == null) { throw new IllegalArgumentException(J3dI18N.getString("Shape3DRetained3")); } pickInfo.setLocalToVWorldRef(localToVworld); Shape3D shape = (Shape3D) path.getObject(); // Get the geometries for this shape only, since the compiled // geomtryList contains several shapes ArrayList glist = (ArrayList) geometryInfo.get(shape.id); // System.err.println("Shape3DCompileRetained.intersect() : "); if (dist == null) { // System.err.println(" no dist request ...."); return intersect(pickInfo, pickShape, 0, glist); } flags = PickInfo.CLOSEST_DISTANCE; if (intersect(pickInfo, pickShape, flags, glist)) { dist[0] = pickInfo.getClosestDistance(); return true; } return false; }