Change Ray to use the generic Tuple instead of Point/Vector (but you still should use Point/Vector for initialisation)

This commit is contained in:
Godzil
2020-02-17 13:54:07 +00:00
parent 17aebe6538
commit cabe7ff147

View File

@@ -14,10 +14,10 @@
class Ray class Ray
{ {
public: public:
Vector direction; Tuple direction;
Point origin; Tuple origin;
Ray(Point origin, Vector direction) : origin(origin), direction(direction) { }; Ray(Tuple origin, Tuple direction) : origin(origin), direction(direction) { };
Tuple position(double t) { return this->origin + this->direction * t; }; Tuple position(double t) { return this->origin + this->direction * t; };
}; };