March 2017
Intermediate to advanced
480 pages
11h 3m
English
So far in this chapter, we have implemented the basic primitives for 2D shapes. Now we are going to implement the most basic primitive test for 2D shapes; point containment. It's often useful to know if a point is inside a shape or not.
We are going to implement a method to check if a point is on a line, as well as methods to check if a point is within a circle, rectangle, and oriented rectangle. These are the most basic 2D intersection tests we can perform.
Follow these steps to test if a point is contained within any of the two-dimensional primitives we have created so far:
Geometry2D.h:bool PointOnLine(const Point2D& point, const Line2D& line); bool PointInCircle(const ...
Read now
Unlock full access