X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FLine.hh;h=33eecb9b3df6f91dec483b8022011eac8cdda2a4;hp=4a54e2d5f008c5bcd62c21340b552ffeb0eb809a;hb=7e84479de612a4ce287c6f63deb014b447a993ec;hpb=2d77fb5fb3480f522658f30af6addd5146530517 diff --git a/src/Moof/Line.hh b/src/Moof/Line.hh index 4a54e2d..33eecb9 100644 --- a/src/Moof/Line.hh +++ b/src/Moof/Line.hh @@ -49,7 +49,15 @@ struct Line : public Drawable, public Shape Vector a; Vector b; - Scalar intersectRay(const Ray<2>& ray, Ray<2>::Intersection& intersection) + + Line() {} + + Line(const Vector& point1, const Vector& point2) : + a(point1), + b(point2) {} + + Scalar intersectRay(const Ray<2>& ray, + Ray<2>::Intersection& intersection) const { // solve: Cx + r*Dx = Ax + s(Bx - Ax) // Cy + r*Dy = Ay + s(By - Ay)