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
|
||||
{
|
||||
public:
|
||||
Vector direction;
|
||||
Point origin;
|
||||
Tuple direction;
|
||||
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; };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user