else { sqDist = Distance.pointToRay (pt, origin, direction, iPnt, null);
if (coordinates.length > 2) { if (cone instanceof PickConeRay) { if (intersectRay(coordinates, new PickRay (origin, direction), dist, iPnt)) { freePoint3d(origin); freePoint3d(end); freePoint3d(iPnt1); freeVector3d(direction); freeVector3d(originToIpnt); freeVector3d(vector); return true; } } else { if (intersectSegment(coordinates, origin, end, dist, iPnt)) { freePoint3d(origin); freePoint3d(end); freePoint3d(iPnt1); freeVector3d(direction); freeVector3d(originToIpnt); freeVector3d(vector); return true; } }
    boolean intersectCone(Point3d pt, PickCone cone, double[] dist)     {	Point3d origin = getPoint3d();	Point3d end = getPoint3d();	Vector3d direction = getVector3d();        Point3d iPnt = getPoint3d();	Vector3d originToIpnt = getVector3d();	// Get cone information	cone.getOrigin (origin);	cone.getDirection (direction);	double radius;	double distance;	double sqDist;	if (iPnt == null) {	    iPnt = new Point3d();	}	if (cone instanceof PickConeSegment) {	    ((PickConeSegment)cone).getEnd (end);	    sqDist = Distance.pointToSegment (pt, origin, end, iPnt, null);	}	else {	    sqDist = Distance.pointToRay (pt, origin, direction, iPnt, null);	}	originToIpnt.sub(iPnt, origin);	distance = originToIpnt.length();	radius = Math.tan (cone.getSpreadAngle()) * distance;	if (sqDist <= radius*radius) {	    dist[0] = distance;	    freePoint3d(origin);	    freePoint3d(end);	    freePoint3d(iPnt);	    freeVector3d(direction);	    freeVector3d(originToIpnt);	    return true;	}	return false;    }