macroing / Dayflower

A photorealistic 3D-renderer written in Java
https://www.dayflower.org
GNU Lesser General Public License v3.0
25 stars 2 forks source link

Add intersection methods to Rectangle2D, Rectangle2F and Rectangle2I #6

Open macroing opened 2 years ago

macroing commented 2 years ago

Add static intersection methods to the Rectangle2D, Rectangle2F and Rectangle2I classes.

These methods should take two instances of the same Rectangle2 type as parameters and return an Optional<Polygon2> with the optional intersection.

They previously had methods returning an Optional<Rectangle2*>. This only works if both are axis-aligned.