Hi,
I have a line and two circles in JavaFX, and I want to know if the line intersects one or more of these circles. I've tried the "intersects" method, but I must not be doing it right, because it doesn't work. At least for me, that is.
Here's my code:
link.setOnMouseReleased(new EventHandler<MouseEvent>() {
public void handle(MouseEvent event) {
if (link.intersects(custCircle.getLayoutBounds())) {
lineIntersects = true;
} else {
lineIntersects = false;
}
if (link.intersects(piCircle.getLayoutBounds())) {
lineIntersects = true;
} else {
lineIntersects = false;
}
if (lineIntersects && custCircleIntersects &&
piCircleIntersects) {
System.out.println("line: intersects all around");
}
}
});
Any help would be greatly appreciated!
Edited by: 891570 on Dec 2, 2011 1:55 PM