I am attempting to test for a collision with a Rectangle2D.Float and a Point2D.Float. I have a 2D world that contains a camera (which transforms the graphics2D canvas based off the camera's AffineTransform). I then have a list of objects X that contain sub-objects Y. The canvas is transformed ontop of the camera's transformation to X's AffineTransformation, so the object is rendered in the correct location. I can successfully test for a collision with the mouse inside Object X, but I am having issues testing for the sub objects Y because the Y objects "think" they are at position (0,0) even though they have been located elsewhere because of their parent object X who was repositioned to say (200,200). So in other words, Object X and Y show up at position (200,200), but the collision happens at (0,0) and not at (200,200) like it is supposed to.
I believe it has to do with the right combination of calling AffineTransform.transform and AffineTransform.inverseTransform, but I cannot wrap my brain around the correct combintation.