March 2017
Intermediate to advanced
480 pages
11h 3m
English
After point containment, the line intersection the is the next logical intersection test to implement. Knowing if a line intersects one of the basic 2D primitives is very useful, and in most cases rather straightforward to implement.
We are going to implement functions to test if a line is intersecting any of the basic 2D primitives. To keep the naming of these functions a little more convenient, we are going to use the #define macro to create aliases for each function.
Follow these steps to test if a line intersects any of the two-dimensional primitives we have defined so far:
Geometry2D.h:bool LineCircle(const Line2D& line, const Circle& circle); bool LineRectangle(const ...
Read now
Unlock full access