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:
@@ -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; };
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user